Commit d1b08819 authored by maoying's avatar maoying

Merge branch 'developer' into temp

parents 85bb81e5 60968472
......@@ -9,7 +9,8 @@ import java.lang.annotation.Target;
/**
* @author DELL
*
* 注解在mapper方法上
* 注解需要数据权限过滤的mapper。
* interfacePath对应为平台菜单管理中菜单组件(全局唯一)。
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
......@@ -20,6 +21,6 @@ public @interface DataAuth {
* 菜单组件
* @return
*/
String interfacePath() default "";
String interfacePath();
}
......@@ -67,7 +67,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 65536, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
if (v.length > 0) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" + k;
......
......@@ -34,6 +34,8 @@ import org.apache.poi.ss.formula.functions.T;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -55,44 +57,61 @@ public class PermissionInterceptor implements Interceptor {
@Autowired
RedisUtils redisUtils;
private String falseCondition = " 1=2";
@Override
public Object intercept(Invocation invocation) throws Throwable {
StatementHandler statementHandler = PluginUtils.realTarget(invocation.getTarget());
MetaObject metaObject = SystemMetaObject.forObject(statementHandler);
MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
// TODO 处理mybatis plus
String dataAuthRule = PermissionInterceptorContext.getDataAuthRule();
// 被拦截方法
Method method = getTargetDataAuthMethod(mappedStatement);
DataAuth dataAuth = getTargetDataAuthAnnotation(mappedStatement);
// 没有DataAuth定义注解的跳过
if (null == dataAuth) {
// 没有DataAuth定义注解的跳过及没有手动指定使用数据规则的跳过
if (null == dataAuth && ValidationUtil.isEmpty(dataAuthRule)) {
PermissionInterceptorContext.clean();
return invocation.proceed();
}
// 接口地址为空返回空数据
if (ValidationUtil.isEmpty(dataAuth.interfacePath())) {
if(!ValidationUtil.isEmpty(dataAuth)){
dataAuthRule = !ValidationUtil.isEmpty(dataAuthRule) ? dataAuthRule : dataAuth.interfacePath();
}
// 数据权限地址为空返回空数据
if(ValidationUtil.isEmpty(dataAuthRule)){
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId()
, RequestContext.getToken())).toString(), ReginParams.class);
if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) {
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
// 用户数据权限配置信息
Map<String, List<PermissionDataruleModel>> dataAuthorization = Privilege.permissionDataruleClient.queryByUser(reginParam.getUserModel().getUserId(),
dataAuth.interfacePath()).getResult();
dataAuthRule).getResult();
// 没有数据权限直接返回空数据
if (ValidationUtil.isEmpty(dataAuthorization)) {
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql");
String sql = boundSql.getSql();
// 将权限规则拼接到原始sql
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
try {
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
} catch (Exception e) {
PermissionInterceptorContext.clean();
logger.debug(e.getMessage());
}
metaObject.setValue("delegate.boundSql.sql", sql);
PermissionInterceptorContext.clean();
return invocation.proceed();
}
......@@ -180,10 +199,10 @@ public class PermissionInterceptor implements Interceptor {
dataAuthorization.entrySet().stream().filter(map -> !ValidationUtil.isEmpty(map.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
// 没有配置数据权限直接返回 false 条件
if (ValidationUtil.isEmpty(nonEmptyDataAuthorization)) {
authSql = " 1=2";
authSql = falseCondition;
} else {
// 解析数据权限sql
authSql = parseDataAuthorization(dataAuthorization, reginParams, mainTableAlias, boundSql);
authSql = parseDataAuthorization(nonEmptyDataAuthorization, reginParams, mainTableAlias, boundSql);
}
// 替换数据权限
if (!ValidationUtil.isEmpty(authSql)) {
......@@ -292,7 +311,8 @@ public class PermissionInterceptor implements Interceptor {
getRuleValue(rule, reginParam, boundSql)) + "'";
} else {
// 包含
authSql = mainTableAlias + "." + rule.getRuleColumn() + " like '" + getRuleValue(rule, reginParam, boundSql) + "'";
authSql = mainTableAlias + "." + rule.getRuleColumn() + " like '%" + getRuleValue(rule,
reginParam, boundSql) + "%'";
}
} else {
// =; >; >=; <; <=; !=
......@@ -326,6 +346,26 @@ public class PermissionInterceptor implements Interceptor {
String attrName = ruleValue.substring(2, ruleValue.length() - 1);
ruleValue = ValidationUtil.isEmpty(map.get(attrName)) ? "" : map.get(attrName).toString();
}
// 从查询参数中获取json字段参数值
if (rule.getRuleColumn().contains("->")) {
Map<String, Object> map;
Map<String, Object> map2 = Maps.newHashMap();
if (boundSql.getParameterObject() instanceof Map) {
map = (Map<String, Object>) boundSql.getParameterObject();
for(Map.Entry<String, Object> entry : map.entrySet()) {
if (entry.getValue() instanceof Map) {
map2.putAll((Map<? extends String, ?>) entry.getValue());
}
}
map.putAll(map2);
} else {
map = Bean.BeantoMap(boundSql.getParameterObject());
}
if(map.containsKey(ruleValue)) {
ruleValue = ValidationUtil.isEmpty(map.get(ruleValue)) ? falseCondition : map.get(ruleValue).toString();
}
}
return ruleValue;
}
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.biz.common.interceptors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PermissionInterceptorContext {
private static final Logger logger = LoggerFactory.getLogger(PermissionInterceptorContext.class);
private static ThreadLocal<PermissionInterceptorContextModel> requestContext = ThreadLocal.withInitial(PermissionInterceptorContextModel::new);
private static PermissionInterceptorContextModel getPermissionInterceptorContext() {
return requestContext.get();
}
public static String getDataAuthRule() {
return getPermissionInterceptorContext().getDataAuthRule();
}
public static void setDataAuthRule(String dataAuthRule) {
getPermissionInterceptorContext().setDataAuthRule(dataAuthRule);
}
public static void clean() {
if (requestContext != null) {
logger.info("clean RestThreadLocal......Begin");
requestContext.remove();
logger.info("clean RestThreadLocal......Done");
}
}
}
package com.yeejoin.amos.boot.biz.common.interceptors;
import org.typroject.tyboot.core.foundation.context.RequestContextEntityType;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class PermissionInterceptorContextModel implements Serializable {
private static final long serialVersionUID = 1L;
private String dataAuthRule;
public String getDataAuthRule() {
return dataAuthRule;
}
public void setDataAuthRule(String dataAuthRule) {
this.dataAuthRule = dataAuthRule;
}
public void clean() {
this.dataAuthRule = null;
}
}
......@@ -23,6 +23,7 @@ public class MessageAction {
MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class);
messageModel.setTitle(title);
messageModel.setBody(RuleUtils.instedParams(content, msgObj));
log.info(String.format("接收规则返回数据: %s", JSON.toJSONString(msgObj)));
if (!ValidationUtil.isEmpty(messageModel)) {
try {
Systemctl.messageClient.create(messageModel);
......
......@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.stereotype.Service;
/**
* @description:
* @author: tw
......@@ -28,65 +29,61 @@ public class SeismometeorologyDtoDao {
/**
* 保存对象SeismometeorologyDto
* @param
*
* @param
*/
public void saveObj(SeismometeorologyDto book) {
mongoTemplate.save(book);
}
/**
*
* 24小時预警
*
* **/
public List<SeismometeorologyDto> findCarStateByWatchSn(){
System.out.println(new Date().getTime());
Query query = new Query(Criteria.where("releaseTime").gte(getStartTime())
.lte(getEndTime()));
Sort sort= Sort.by(Sort.Direction.DESC, "releaseTime");
query.with(sort);
List<SeismometeorologyDto> gpsList = mongoTemplate.find(query, SeismometeorologyDto.class);
return gpsList;
**/
public List<SeismometeorologyDto> findCarStateByWatchSn() {
System.out.println(new Date().getTime());
Query query = new Query(Criteria.where("releaseTime").gte(getStartTime())
.lte(getEndTime()));
Sort sort = Sort.by(Sort.Direction.DESC, "releaseTime");
query.with(sort);
List<SeismometeorologyDto> gpsList = mongoTemplate.find(query, SeismometeorologyDto.class);
return gpsList;
}
/**
*
*当天气象预警
*
* **/
public List<SeismometeorologyDto> findDutyCarStateBy(){
* 当天气象预警
**/
public List<SeismometeorologyDto> findDutyCarStateBy() {
System.out.println(new Date().getTime());
Query query = new Query(Criteria.where("releaseTime").gte(getStartTime())
.lte(getEndTime()));
Sort sort= Sort.by(Sort.Direction.DESC, "releaseTime");
.lte(getEndTime()));
Sort sort = Sort.by(Sort.Direction.DESC, "releaseTime");
query.with(sort);
List<SeismometeorologyDto> gpsList = mongoTemplate.find(query, SeismometeorologyDto.class);
return gpsList;
}
private static Date getStartTime() {
Calendar todayStart = Calendar.getInstance();
todayStart.set(Calendar.HOUR_OF_DAY,0);
todayStart.set(Calendar.MINUTE,0);
todayStart.set(Calendar.SECOND,0);
todayStart.set(Calendar.MILLISECOND,0);
return todayStart.getTime();
Calendar todayStart = Calendar.getInstance();
todayStart.set(Calendar.HOUR_OF_DAY, 0);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(Calendar.MILLISECOND, 0);
return todayStart.getTime();
}
private static Date getEndTime() {
Calendar todayEnd = Calendar.getInstance();
todayEnd.set(Calendar.HOUR_OF_DAY,23);
todayEnd.set(Calendar.MINUTE,59);
todayEnd.set(Calendar.SECOND,59);
todayEnd.set(Calendar.MILLISECOND,999);
return todayEnd.getTime();
Calendar todayEnd = Calendar.getInstance();
todayEnd.set(Calendar.HOUR_OF_DAY, 23);
todayEnd.set(Calendar.MINUTE, 59);
todayEnd.set(Calendar.SECOND, 59);
todayEnd.set(Calendar.MILLISECOND, 999);
return todayEnd.getTime();
}
}
......@@ -46,7 +46,7 @@ public class ContractDto extends BaseDto {
private String contractNo;
@ApiModelProperty(value = "机构代码用于权限过滤")
private Boolean orgCode;
private String orgCode;
@ApiModelProperty(value = "单位名称")
private String company;
......
......@@ -61,7 +61,7 @@ public class Contract extends BaseEntity {
* 机构代码用于权限过滤
*/
@TableField("org_code")
private Boolean orgCode;
private String orgCode;
/**
* 单位名称
*/
......
......@@ -167,14 +167,18 @@ public class ExcelUtil {
String[] postTypeNamestrings = new String[postTypeNameDetailList.size()];
List<String> userNameDetailList = (List<String>) detail.get(detail.size()-3);
String[] userNamestrings = new String[userNameDetailList.size()];
List<String> companyNameList = (List<String>) detail.get(detail.size()-4);
String[] companyNameLists = new String[companyNameList.size()];
map.put(4, fireStationDetailList.toArray(strings));
map.put(3, postTypeNameDetailList.toArray(postTypeNamestrings));
map.put(2, userNameDetailList.toArray(userNamestrings));
map.put(1, companyNameList.toArray(companyNameLists));
map.putAll(explicitListConstraintMap);
fireStationExplicitListConstraintMap.add(map);
detail.remove(detail.size()-1);
detail.remove(detail.size()-1);
detail.remove(detail.size()-1);
detail.remove(detail.size()-1);
resultList.add(detail);
});
excelWriterSheetBuilder
......
package com.yeejoin.amos.boot.module.common.api.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import io.swagger.annotations.ApiOperation;
@FeignClient(name = "${amosTraining.fegin.name:AMOS-TRAININGEXAM}", path = "trainingexam", configuration = {MultipartSupportConfig.class})
public interface AmosTrainingFeignClient {
@RequestMapping(value = "/trainingProject/update/operation/number", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改人员编号", notes = "修改人员编号")
public ResponseModel<Boolean> updOperationNumber(@RequestParam String newNumber,@RequestParam String oldNumber) ;
}
......@@ -183,7 +183,9 @@ public interface EquipFeignClient {
* @return
*/
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current, @RequestParam("size") long size, @RequestParam("buildingId") Long buildingId);
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current,
@RequestParam("size") long size,
@RequestParam("buildingId") Long buildingId);
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current,
......@@ -203,13 +205,11 @@ public interface EquipFeignClient {
);
@RequestMapping(value = "/confirmAlarm/getDetailsById", method = RequestMethod.GET)
public ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId, @RequestParam(required = false) Long equipId, @RequestParam(required = false) String type, @RequestParam String area) ;
ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId,
@RequestParam(required = false) Long equipId,
@RequestParam(required = false) String type,
@RequestParam String area) ;
/**
*
*获取视频列表
......@@ -217,7 +217,11 @@ public interface EquipFeignClient {
* @return
*/
@RequestMapping(value = "/video/pageVideo", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> pageVideo( @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("longitude") Double longitude,@RequestParam("latitude") Double latitude,@RequestParam("distance") Double distance);
ResponseModel<Page<Map<String, Object>>> pageVideo(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("longitude") Double longitude,
@RequestParam("latitude") Double latitude,
@RequestParam("distance") Double distance);
@RequestMapping(value = "/video/pageList", method = RequestMethod.GET)
......
......@@ -60,8 +60,11 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("appKey") String appKey,
@Param("groupCode") String groupCode
);
List<Map<String, Object>> newStationViewData(
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode
);
/**
* 利用mysql 生成连续时间区间
*
......@@ -137,4 +140,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
String getFirstAidCompanyId ();
}
......@@ -30,7 +30,14 @@ public interface IDutyCommonService {
* @return ResponseModel
*/
List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
/**
* 新值班月视图
* @param beginDate
* @param endDate
* @return
* @throws ParseException
*/
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException;
/**
* 不分页查询
*
......
......@@ -166,4 +166,8 @@ public interface IMaintenanceCompanyService {
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
List<MaintenanceCompany> findByCodeAndType(String code, String type);
List<MaintenanceCompany> findPersonByAmosOrgId(String code, String userId);
MaintenanceCompany getOne(Long parentId);
}
......@@ -108,8 +108,8 @@ public interface IOrgUsrService {
* @throws Exception
*/
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
......@@ -145,7 +145,9 @@ public interface IOrgUsrService {
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception;
/**
* * @param null
*
......@@ -185,7 +187,7 @@ public interface IOrgUsrService {
List<Map<String, Object>> getparent();
List<OrgUsrExcelDto> exportToExcel( Map par);
List<OrgUsrExcelDto> exportToExcel(Map par);
UserUnitDto getUserUnit(String userId);
......@@ -226,7 +228,7 @@ public interface IOrgUsrService {
*
* @param orgUserId
* @return
* @exception
* @throws
*/
AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception;
......@@ -235,12 +237,13 @@ public interface IOrgUsrService {
*
* @param orgUserIds
* @return
* @exception
* @throws
*/
List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
*
* @param ids
* @return
*/
......@@ -252,12 +255,12 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ;
List<OrgUsr> getPersonListByParentIds(List<String> ids);
List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
public OrgUsr getDetailById( Long id);
OrgUsr getDetailById(Long id);
/**
......@@ -275,7 +278,7 @@ public interface IOrgUsrService {
* @throws Exception
*/
List<OrgMenuDto> getTreeFlc(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
OrgUsrDto saveOrgPersonFlc(OrgPersonDto OrgPersonDto) throws Exception;
......
......@@ -87,6 +87,21 @@
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="newStationViewData" resultType="java.util.Map">
select
i.field_value as postTypeName,
count(1) as total
from
cb_duty_person_shift s,
cb_dynamic_form_instance i
where
s.instance_id = i.instance_id
and i.field_code = 'postTypeName'
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="genRangeDate" resultType="map">
SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
......@@ -187,6 +202,50 @@ select * from (
group by ${groupByName}
</if>
</select>
<select id='getNewEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result
<if test="groupByName != null and groupByName!='' ">
group by ${groupByName}
</if>
</select>
<select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'>
SELECT
......@@ -288,7 +347,7 @@ FROM
GROUP BY
cd.instance_id
) ss
LEFT JOIN (
<!-- LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
......@@ -301,7 +360,7 @@ LEFT JOIN (
AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id
WHERE
cds.NAME =#{duty}
cds.NAME =#{duty} -->
GROUP BY
ss.postTypeName
</select>
......@@ -331,6 +390,16 @@ WHERE
</select>
<select id='getFirstAidCompanyId' resultType="string">
SELECT
sequence_nbr
FROM
cb_org_usr a
WHERE
a.is_delete = 0
AND
a.biz_org_name = '消防救援保障部'
</select>
<select id='getFirstAidForTypeCodeAndCompanyId' resultType="map">
SELECT
......
......@@ -519,7 +519,9 @@ AND instance_id = (
jc_user_car
WHERE
car_id = #{carId}
and is_delete = 0
)
and is_delete = 0
) and field_code='telephone'
) ss
LEFT JOIN cb_org_usr cou ON ss.instance_id = cou.sequence_nbr
......
......@@ -60,13 +60,13 @@
and submission_time between #{startTime} and #{endTime}
</if>
<if test="submissionName != null ">
and submission_name = #{submissionName}
and submission_name like concat ('%', #{submissionName},'%')
</if>
<if test="submissionBranchId!= null ">
and submission_branch_id = #{submissionBranchId}
and submission_branch_id= #{submissionBranchId}
</if>
<if test="sequenceNbr!= null ">
and sequence_nbr = #{ sequenceNbr}
and sequence_nbr like concat ('%',#{ sequenceNbr},'%')
</if>
</where>
order by submission_time DESC limit #{current},#{size}
......
......@@ -135,7 +135,7 @@ public class FireEquipment implements Serializable {
@ApiModelProperty(value = "是否组合设备")
@TableField("combinedequipment")
private String combinedequipment;
private Boolean combinedequipment = false;
@ApiModelProperty(value = "出厂编号")
@TableField("factorynumber")
......@@ -167,7 +167,7 @@ public class FireEquipment implements Serializable {
@ApiModelProperty(value = "重要性")
@TableField("critical")
private String critical;
private Boolean critical = false;
@ApiModelProperty(value = "电子地址")
@TableField("electronicaddress")
......
......@@ -101,4 +101,10 @@ public class Equipment extends BaseEntity {
*/
@TableField(value = "is_iot")
private String isIot = "0";
/**
* 警情消除策略 【0:收到复位信号自动消除;1:警情处理确认后消除】
*/
@TableField(value = "clean_type")
private String cleanType = "0";
}
......@@ -135,4 +135,12 @@ public class EquipmentSpecific extends BaseEntity {
* 存放位置冗余字段
*/
private Long warehouseStructureId;
@ApiModelProperty(value = "告警状态")
@TableField(exist = false)
private Integer status;
@ApiModelProperty(value = "系统名称")
@TableField(exist = false)
private String systemName;
}
......@@ -125,6 +125,10 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("equipment_index_id")
private Long equipmentIndexId;
@ApiModelProperty(value = "报警状态1报警0恢复")
@TableField("status")
private Integer status;
@ApiModelProperty(value = "画布id")
@TableField(exist = false)
private Long sceneId;
......@@ -176,4 +180,12 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("build_id")
@ApiModelProperty(value = "建筑id")
private String buildId;
@TableField("clean_time")
@ApiModelProperty(value = "消除时间")
private Date cleanTime;
@ApiModelProperty(value = "消除状态")
@TableField(exist = false)
private String cleanStatus;
}
......@@ -23,4 +23,6 @@ public class AlamVideoVO {
private String presetPosition;
private String vedioFormat;
}
......@@ -43,5 +43,6 @@ public class BuildingVideoVO {
@ApiModelProperty("详细地址")
private String presetPosition;
@ApiModelProperty("视频转码")
private String vedioFormat;
}
......@@ -68,4 +68,10 @@ public class CarPropertyVo {
@ApiModelProperty(value = "创建日期")
private Date createDate;
/**
* 单位名称
*/
@ApiModelProperty(value = "mRid")
private String mRid;
}
......@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO {
* 告警类型
*/
private String type;
private Integer cleanStatus;
}
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: AlarmCleanTypeEnum
* <pre>
* @description: TODO
* </pre>
* @date 2022/01/05 12:04
*/
@AllArgsConstructor
@Getter
public enum AlarmCleanTypeEnum {
ZDXC("0", "收到复位信号自动消除"), QRXC("1", "警情处理确认后消除");
private String code;
private String name;
}
......@@ -20,29 +20,30 @@ import javax.servlet.http.HttpServletRequest;
@RestControllerAdvice
public class GlobalExceptionHandler {
private Logger log = LoggerFactory.getLogger(this.getClass());
public GlobalExceptionHandler() {
}
@ExceptionHandler({ Exception.class })
public ResponseModel<Object> MethodArgumentNotValidHandler(Exception exception) throws Exception {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest();
ResponseModel<Object> response = new ResponseModel<>();
//解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面
if(exception.getMessage()!=null&&exception.getMessage().indexOf("账号已经在其他设备登录")!=-1 ||exception.getMessage().indexOf("请重新登录")!=-1){
response.setStatus(HttpStatus.FORBIDDEN.value());
}else{
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
}
response.setDevMessage("FAILED");
response.setMessage( exception.getMessage());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());exception.printStackTrace();
return response;
}
private Logger log = LoggerFactory.getLogger(this.getClass());
public GlobalExceptionHandler() {
}
@ExceptionHandler({Exception.class})
public ResponseModel<Object> MethodArgumentNotValidHandler(Exception exception) throws Exception {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest();
ResponseModel<Object> response = new ResponseModel<>();
//解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面
if (exception.getMessage() != null && (exception.getMessage().contains("账号已经在其他设备登录") || exception.getMessage().contains("请重新登录"))) {
response.setStatus(HttpStatus.FORBIDDEN.value());
} else {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
}
response.setDevMessage("FAILED");
response.setMessage(exception.getMessage());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
exception.printStackTrace();
return response;
}
}
......@@ -109,6 +109,26 @@ public class CommonPageInfoParam extends CommonPageable {
*/
private List<String> buildIds;
private String status;
public void setCleanStatus(String cleanStatus) {
this.cleanStatus = cleanStatus;
}
public String getCleanStatus() {
return cleanStatus;
}
private String cleanStatus;
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setWarehouseStructureName(String warehouseStructureName) {
this.warehouseStructureName = warehouseStructureName;
}
......
......@@ -55,6 +55,10 @@ public class CommonPageParamUtil {
param.setBuildId(toString(queryRequests.get(i).getValue()));
} else if("buildIds".equals(name)){
param.setBuildIds((List<String>)queryRequests.get(i).getValue());
} else if("status".equals(name)){
param.setStatus(toString(queryRequests.get(i).getValue()));
} else if("cleanStatus".equals(name)){
param.setCleanStatus(toString(queryRequests.get(i).getValue()));
}
}
if(commonPageable !=null){
......
......@@ -23,6 +23,8 @@ public class AlarmListDataVO {
private String alarmEquip;
private String type;
private String alarmType;
private String alarmInfo;
......@@ -32,4 +34,8 @@ public class AlarmListDataVO {
private Long alarmId;
private String alarmTypeCode;
}
private String cleanStatus;
private String cleanStatusVal;
}
\ No newline at end of file
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author keyong
* @title: TopographyAlarmVo
* <pre>
* @description: TODO
* </pre>
* @date 2021/12/29 18:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopographyAlarmVo {
private Date createDate;
private String fireEquipmentSpecificIndexName;
private String fireEquipmentName;
private String warehouseStructureName;
private String equipmentName;
private String handleStatus;
private String handleType;
private String alarmType;
private String alarmContent;
private String status;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: IotDataVO
* <pre>
* @description: 物联系统发送的增量数据封装VO
* </pre>
* @date 2021/1/7 17:44
*/
@Data
public class TopographyIotDataVO {
private String name;
private Object value;
private String unit;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: TopographyAlarmVo
* <pre>
* @description: TODO
* </pre>
* @date 2021/12/29 18:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopographyIotVo {
private Date time;
private List<TopographyIotDataVO> list;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoOnEquipmentSpecificVo
* @Author: Jianqiang Gao
* @Description: 摄像头绑定设备
* @Date: 2022/1/7 17:35
* @Version: 1.0
*/
@Data
public class VideoOnEquipmentSpecificVo {
/**
* 设备ID
*/
private Long equipmentSpecificId;
/**
* 摄像头Id集合
*/
private List<Long> videoIdList;
}
\ No newline at end of file
......@@ -41,8 +41,9 @@ public class AlertSubmittedObject extends BaseEntity {
@ApiModelProperty(value = "人员id")
private Long userId;
@TableField("user_name")
@ApiModelProperty(value = "人员名称")
private String userName;
private String theUser;
@ApiModelProperty(value = "人员电话")
private String userPhone;
......
......@@ -150,7 +150,7 @@
</select>
<select id="getOther" resultType="Map">
SELECT distinct
SELECT distinct
a.rec_date recDate ,
b.company_name companyName,
c.resources_name carName,
......@@ -161,9 +161,9 @@
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr = (select sequence_nbr from jc_power_transfer where alert_called_id
where a.sequence_nbr in (select sequence_nbr from (select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId}
order by rec_date asc limit 1,100)
order by rec_date asc limit 1,100) as t )
</select>
......
package com.yeejoin.amos.latentdanger.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum AuditEnum {
AUDIT("待审核","audit"),
REVIEW("待复核","review");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
AuditEnum(String name, String code){
this.name = name;
this.code = code;
}
public static AuditEnum getEnum(String code) {
AuditEnum auditEnum = null;
for(AuditEnum type: AuditEnum.values()) {
if (type.getCode().equals(code)) {
auditEnum = type;
break;
}
}
return auditEnum;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (AuditEnum c: AuditEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("code", c.getCode());
nameList.add(map);
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -5,6 +5,7 @@ public enum ExecuteStateEnum {
未执行("未执行", 1, ""),
通过("通过", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
完毕("完毕", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
驳回("驳回", 3, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
已确认("已确认", 4, ""),
停止执行("停止执行", 5, ""),
......
......@@ -7,7 +7,7 @@ public enum LatentDangerExcuteTypeEnum {
"{\"reviewResult\": \"通过\"}"),
隐患评审拒绝("隐患评审拒绝", 3, ExecuteStateEnum.驳回, LatentDangerStateEnum.已撤销,
"{\"reviewResult\": \"不通过\"}"),
隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证,
隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.完毕, LatentDangerStateEnum.待验证,
"{\"rectifyResult\": \"常规整改\"}"),
隐患安措计划("隐患安措计划", 5, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"),
......
......@@ -21,7 +21,7 @@
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.0.3</version>
<version>4.0.0</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
......@@ -32,12 +32,12 @@
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.0.3</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.0.3</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
......
......@@ -85,6 +85,11 @@ public class DangerDto implements Serializable {
private List<String> photoUrl;
/**
* 隐患图片列表
*/
private String photoUrls;
/**
* 检查项名称
*/
private String inputItemName;
......
package com.yeejoin.amos.boot.module.tzs.api.enums;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum InformWorkFlowEnum {
企业提交审批("submitInform","企业提交审批","0"),
接收方接收告知书("acceptInform","接收方接收告知书","9"),
接收方移交告知书("transferInform","接收方移交告知书","1"),
企业撤回告知书("withdrawInform","企业撤回告知书","2"),
接收方驳回告知书("dismissInform","接收方驳回告知书","3"),
企业撤销告知书("cancelInform","企业撤销告知书","-1");
private String code;//流程编码
private String stage;//流程阶段
private String processStatus;// 流程状态
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getStage() {
return stage;
}
public void setStage(String stage) {
this.stage = stage;
}
public String getProcessStatus() {
return processStatus;
}
public void setProcessStatus(String processStatus) {
this.processStatus = processStatus;
}
}
......@@ -82,6 +82,6 @@ public class CylinderInfoDto extends BaseDto {
private Boolean syncState;
@ApiModelProperty(value = "对接公司编码")
private String apiCompanyCode;
private String appId;
}
......@@ -90,8 +90,8 @@ public class CylinderUnitDto extends BaseDto {
@ApiModelProperty(value = "1初次同步数据 2上层系统已同步数据 0已删除数据")
private Boolean syncState;
@ApiModelProperty(value = "对接公司编码")
private String apiCompanyCode;
@ApiModelProperty(value = "对接公司编码")
private String appId;
@ApiModelProperty(value = "气瓶数量")
private Long cylinderNumber;
......
......@@ -79,7 +79,7 @@ public class EquipmentDto extends BaseDto {
private String productCode;
@ApiModelProperty(value = "监督检验机构")
private Long supervisionAgency;
private String supervisionAgency;
@ApiModelProperty(value = "检验报告编号")
private String inspectionReportCode;
......@@ -101,4 +101,16 @@ public class EquipmentDto extends BaseDto {
@ApiModelProperty(value = "设备所属单位")
private String equipUnit;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
}
package com.yeejoin.amos.boot.module.tzs.flc.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-12-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="EquipmentIndexInformDto", description="设备指标")
public class EquipmentIndexInformDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@ApiModelProperty(value = "设备名称")
private String equipmentName;
@ApiModelProperty(value = "指标值")
private String value;
@ApiModelProperty(value = "装备定义指标id")
private Long defIndexId;
@ApiModelProperty(value = "装备定义指标名称")
private String defIndexName;
@ApiModelProperty(value = "装备定义指标key")
private String defIndexKey;
}
......@@ -130,4 +130,29 @@ public class EquipmentInformDto extends BaseDto {
@TableField(exist = false)
private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "设备数量")
private Integer equipmentNum;
@ApiModelProperty(value = "开始-施工告知日期")
private String productInformDateStart;
@ApiModelProperty(value = "结束-施工告知日期")
private String productInformDateEnd;
@ApiModelProperty(value = "开始-计划施工日期")
private String planProductDateStart;
@ApiModelProperty(value = "结束-计划施工日期")
private String planProductDateEnd;
@ApiModelProperty(value = "施工区域")
private String productArea;
@ApiModelProperty(value = "流程ID")
private String processId;
@ApiModelProperty(value = "流程状态")
private String processStatus;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
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 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="EquipmentUseInfoDto", description="设备使用信息表")
public class EquipmentUseInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "使用单位名称")
private String useUnitName;
@ApiModelProperty(value = "使用单位id")
private Long useUnitId;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useOrganizationCode;
@ApiModelProperty(value = "产权单位名称")
private String propertyUnitName;
@ApiModelProperty(value = "产权单位id")
private Long propertyUnitId;
@ApiModelProperty(value = "产权统一信用代码")
private String propertyOrganizationCode;
@ApiModelProperty(value = "使用地址")
private String useAddress;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "使用场所")
private String useSite;
@ApiModelProperty(value = "使用场所编码")
private String useSiteCode;
@ApiModelProperty(value = "特设编码")
private String specialCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "96333识别码")
private String rescueCode;
@ApiModelProperty(value = "使用登记证编码")
private String registerLicenceCode;
@ApiModelProperty(value = "登记机关")
private String registerOrg;
@ApiModelProperty(value = "登记机关id")
private Long registerOrgId;
@ApiModelProperty(value = "登记日期")
private Date registerTime;
@ApiModelProperty(value = "发证日期")
private Date issueLicenceTime;
@ApiModelProperty(value = "投入使用日期")
private Date startUseTime;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
}
......@@ -108,4 +108,16 @@ public class InformEquipmentDto extends BaseDto {
private List<EquipmentIndexDto> equipmentIndex;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
}
package com.yeejoin.amos.boot.module.tzs.flc.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-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="InformProcessInfoDto", description="通话记录附件")
public class InformProcessInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "流转内容")
private String processInfo;
@ApiModelProperty(value = "流程操作人")
private String handler;
@ApiModelProperty(value = "操作人所属单位id")
private Long handlerUnitId;
@ApiModelProperty(value = "流程状态")
private String processStatus;
@ApiModelProperty(value = "流程操作人id")
private Long handlerId;
@ApiModelProperty(value = "操作人所属单位")
private String handlerUnit;
@ApiModelProperty(value = "流程id")
private String processId;
@ApiModelProperty(value = "告知书id")
private Long informId;
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -150,7 +151,6 @@ public class CylinderInfo {
/**
* 对接公司编码
*/
@TableField("api_company_code")
private String apiCompanyCode;
@TableField("app_id")
private String appId;
}
......@@ -168,8 +168,8 @@ public class CylinderUnit {
/**
* 对接公司编码
*/
@TableField("api_company_code")
private String apiCompanyCode;
@TableField("app_id")
private String appId;
/**
* 经度
......
......@@ -129,7 +129,7 @@ public class Equipment extends BaseEntity {
* 监督检验机构
*/
@TableField("supervision_agency")
private Long supervisionAgency;
private String supervisionAgency;
/**
* 检验报告编号
......@@ -155,4 +155,29 @@ public class Equipment extends BaseEntity {
@TableField("equip_unit")
private String equipUnit;
/**
* 详细地址
*/
@TableField("address")
private String address;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 所属区域代码
*/
@TableField("region_code")
private String regionCode;
}
package com.yeejoin.amos.boot.module.tzs.flc.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-12-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_equipment_index_inform")
public class EquipmentIndexInform extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 设备id
*/
@TableField("equipment_id")
private Long equipmentId;
/**
* 设备名称
*/
@TableField("equipment_name")
private String equipmentName;
/**
* 指标值
*/
@TableField("value")
private String value;
/**
* 装备定义指标id
*/
@TableField("def_index_id")
private Long defIndexId;
/**
* 装备定义指标名称
*/
@TableField("def_index_name")
private String defIndexName;
/**
* 装备定义指标key
*/
@TableField("def_index_key")
private String defIndexKey;
}
......@@ -215,9 +215,20 @@ public class EquipmentInform extends BaseEntity {
private String informCode;
/**
* 告知单状态 0 暂存 1未接收 9已接收
* 告知单状态 0 暂存 1未接收 2已接收
*/
@TableField("inform_status")
private String informStatus;
/**
* 流程ID
*/
@TableField("process_id")
private String processId;
/**
* 流程状态
*/
@TableField("process_status")
private String processStatus;
}
package com.yeejoin.amos.boot.module.tzs.flc.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 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_equipment_use_info")
public class EquipmentUseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 使用单位名称
*/
@TableField("use_unit_name")
private String useUnitName;
/**
* 使用单位id
*/
@TableField("use_unit_id")
private Long useUnitId;
/**
* 使用单位统一信用代码
*/
@TableField("use_organization_code")
private String useOrganizationCode;
/**
* 产权单位名称
*/
@TableField("property_unit_name")
private String propertyUnitName;
/**
* 产权单位id
*/
@TableField("property_unit_id")
private Long propertyUnitId;
/**
* 产权统一信用代码
*/
@TableField("property_organization_code")
private String propertyOrganizationCode;
/**
* 使用地址
*/
@TableField("use_address")
private String useAddress;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 使用场所
*/
@TableField("use_site")
private String useSite;
/**
* 使用场所编码
*/
@TableField("use_site_code")
private String useSiteCode;
/**
* 特设编码
*/
@TableField("special_code")
private String specialCode;
/**
* 设备注册代码
*/
@TableField("register_code")
private String registerCode;
/**
* 96333识别码
*/
@TableField("rescue_code")
private String rescueCode;
/**
* 使用登记证编码
*/
@TableField("register_licence_code")
private String registerLicenceCode;
/**
* 登记机关
*/
@TableField("register_org")
private String registerOrg;
/**
* 登记机关id
*/
@TableField("register_org_id")
private Long registerOrgId;
/**
* 登记日期
*/
@TableField("register_time")
private Date registerTime;
/**
* 发证日期
*/
@TableField("issue_licence_time")
private Date issueLicenceTime;
/**
* 投入使用日期
*/
@TableField("start_use_time")
private Date startUseTime;
/**
* 设备id
*/
@TableField("equipment_id")
private Long equipmentId;
}
......@@ -165,4 +165,29 @@ public class InformEquipment extends BaseEntity {
*/
@TableField("source_equipment_id")
private Long sourceEquipmentId;
/**
* 详细地址
*/
@TableField("address")
private String address;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 所属区域代码
*/
@TableField("region_code")
private String regionCode;
}
package com.yeejoin.amos.boot.module.tzs.flc.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-12-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_inform_process_info")
public class InformProcessInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 流转内容
*/
@TableField("process_info")
private String processInfo;
/**
* 流程操作人
*/
@TableField("handler")
private String handler;
/**
* 操作人所属单位id
*/
@TableField("handler_unit_id")
private Long handlerUnitId;
/**
* 流程状态
*/
@TableField("process_status")
private String processStatus;
/**
* 流程操作人id
*/
@TableField("handler_id")
private Long handlerId;
/**
* 操作人所属单位
*/
@TableField("handler_unit")
private String handlerUnit;
/**
* 流程id
*/
@TableField("process_id")
private String processId;
/**
* 告知书id
*/
@TableField("inform_id")
private Long informId;
}
......@@ -10,7 +10,8 @@ public enum EquipmentInformStatusEnum {
暂存("0", "暂存"),
未接收("1", "未接收"),
已接收("2", "已接收");
已接收("2", "已接收"),
已驳回("9", "已驳回");
private String code;
......
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设备指标 Mapper 接口
*
* @author system_generator
* @date 2021-12-29
*/
public interface EquipmentIndexInformMapper extends BaseMapper<EquipmentIndexInform> {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 设备告知单 Mapper 接口
......@@ -11,4 +17,35 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface EquipmentInformMapper extends BaseMapper<EquipmentInform> {
Page<List<EquipmentInformDto>> queryDtoList(Page<EquipmentInformDto> page,
@Param("productCode") String productCode,
@Param("productInformDateStart") String productInformDateStart,
@Param("productInformDateEnd") String productInformDateEnd,
@Param("productUnitId") Long productUnitId,
@Param("regionCode") String regionCode,
@Param("address") String address,
@Param("planProductDateStart") String planProductDateStart,
@Param("planProductDateEnd") String planProductDateEnd,
@Param("acceptUnitId") Long acceptUnitId,
@Param("informStatus") String informStatus,
@Param("sortParam") String sortParam,
@Param("sortRule") String sortRule,
@Param("companyId") Long companyId);
Page<List<EquipmentInformDto>> queryDtoListSub(Page<EquipmentInformDto> page,
@Param("productCode") String productCode,
@Param("productInformDateStart") String productInformDateStart,
@Param("productInformDateEnd") String productInformDateEnd,
@Param("productUnitId") Long productUnitId,
@Param("regionCode") String regionCode,
@Param("address") String address,
@Param("planProductDateStart") String planProductDateStart,
@Param("planProductDateEnd") String planProductDateEnd,
@Param("acceptUnitId") Long acceptUnitId,
@Param("informStatus") String informStatus,
@Param("sortParam") String sortParam,
@Param("sortRule") String sortRule,
@Param("companyId") Long companyId);
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设备使用信息表 Mapper 接口
*
* @author system_generator
* @date 2022-01-05
*/
public interface EquipmentUseInfoMapper extends BaseMapper<EquipmentUseInfo> {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.InformProcessInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 通话记录附件 Mapper 接口
*
* @author system_generator
* @date 2021-12-27
*/
public interface InformProcessInfoMapper extends BaseMapper<InformProcessInfo> {
}
......@@ -16,4 +16,12 @@ import java.util.List;
public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
List<UnitInfoDto> getUnitByType(@Param("typeCode") String typeCode);
List<UnitInfoDto> getAllUnit();
List<UnitInfoDto> getUnitByTypeParams(@Param("typeCode") String typeCode,
@Param("unitType") String unitType,
@Param("address") String address,
@Param("orgName") String orgName,
@Param("organizationCode") String organizationCode);
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentAssociatedDto;
/**
* 配套设备/设施/部件接口类
*
......@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/
public interface IEquipmentAssociatedService {
EquipmentAssociatedDto updateAssociated(EquipmentAssociatedDto model);
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
/**
* 设备指标接口类
*
* @author system_generator
* @date 2021-12-29
*/
public interface IEquipmentIndexInformService {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import java.util.List;
/**
* 设备告知单接口类
*
......@@ -11,6 +15,100 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
*/
public interface IEquipmentInformService {
EquipmentInformDto createEquipmentInform(EquipmentInformDto model);
EquipmentInformDto createEquipmentInform(EquipmentInformDto model, ReginParams userInfo);
/**
* 获取本单位提交的告知书列表
* @param page
* @param equipmentInformDto
* @param sortParam
* @param sortRule
* @return
*/
Page<EquipmentInformDto> queryDtoList(Page<EquipmentInformDto> page, EquipmentInformDto equipmentInformDto, String sortParam, String sortRule);
/**
* 获取监管端查看的告知书列表
* @param page
* @param equipmentInformDto
* @param sortParam
* @param sortRule
* @return
*/
Page<EquipmentInformDto> queryDtoListSub(Page<EquipmentInformDto> page, EquipmentInformDto equipmentInformDto, String sortParam, String sortRule);
Boolean batchDelete(List<Long> sequenceNbrList);
Boolean acceptInform(Long sequenceNbr);
EquipmentInformDto updateEquipmentInform(EquipmentInformDto model, ReginParams userInfo);
EquipmentInformDto queryDtoBySeq(Long sequenceNbr);
/**
* 启动 告知书流程
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean startWorkflow(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 接收方接收告知书
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean acceptInform(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 企业移交告知书
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean transferInform(Long sequenceNbr, ReginParams userInfo, Long transferUnitId) throws Exception;
/**
* 企业撤回告知书
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean withdrawInform(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 接收方驳回告知书
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean dismissInform(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 企业撤销告知书
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean cancelInform(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 企业再次提交
* @param sequenceNbr
* @param userInfo
* @return
* @throws Exception
*/
Boolean reSubmit(Long sequenceNbr, ReginParams userInfo) throws Exception;
/**
* 监管端撤回已经通过的告知书
* @param sequenceNbr
* @return
*/
Boolean callbackInform(Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
/**
* 设备使用信息表接口类
*
* @author system_generator
* @date 2022-01-05
*/
public interface IEquipmentUseInfoService {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
/**
* 通话记录附件接口类
*
* @author system_generator
* @date 2021-12-27
*/
public interface IInformProcessInfoService {
// 保存流程过程记录
Boolean saveProcessInfo(EquipmentInformDto model, ReginParams userInfo, String processStage) throws Exception;
}
......@@ -37,5 +37,7 @@ public interface IUnitInfoService {
List<UnitInfoDto> getInspectionUnit();
List<UnitInfoDto> getUseUnit();
List<UnitInfoDto> getAllUnit();
List<UnitInfoDto> getUseUnit(String unitType, String address, String orgName, String organizationCode);
}
......@@ -11,9 +11,9 @@
tz_cylinder_info t
WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code )
AND t.api_company_code = (
AND t.app_id = (
SELECT
u.api_company_code
u.app_id
FROM
tz_cylinder_unit u
WHERE
......
<?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.tzs.flc.api.mapper.EquipmentIndexInformMapper">
</mapper>
......@@ -2,4 +2,140 @@
<!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.tzs.flc.api.mapper.EquipmentInformMapper">
<select id="queryDtoList" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.product_code AS productCode,
a.product_unit AS productUnit,
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.product_unit_id = #{companyId}
<if test="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<if test="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<if test="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<if test="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<if test="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<if test="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<if test="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<if test="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<if test="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<if test="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
<select id="queryDtoListSub" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.product_code AS productCode,
a.product_unit AS productUnit,
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.accept_unit_id = #{companyId}
AND a.inform_status != 0
<if test="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<if test="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<if test="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<if test="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<if test="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<if test="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<if test="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<if test="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<if test="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<if test="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
</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.tzs.flc.api.mapper.EquipmentUseInfoMapper">
</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.tzs.flc.api.mapper.InformProcessInfoMapper">
</mapper>
......@@ -12,5 +12,43 @@
AND a.unit_type_code LIKE CONCAT('%', #{typeCode}, '%')
</select>
<select id="getAllUnit" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto">
select
a.*
from tz_flc_unit_info a
where a.is_delete = 0
AND
(a.unit_status = '1' or a.is_change = 1)
</select>
<select id="getUnitByTypeParams" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto">
select
a.*,
CONCAT(a.province, a.city, a.district ,a.stree,a.community,a.address ) as fullAddress
from tz_flc_unit_info a
where a.is_delete = 0 AND
(a.unit_status = '1' or a.is_change = 1)
AND a.unit_type_code LIKE CONCAT('%', #{typeCode}, '%')
<if test="unitType != null and unitType != ''">
AND a.unit_type LIKE CONCAT('%', #{unitType}, '%')
</if>
<if test="address != null and address != ''">
AND ( a.province LIKE CONCAT('%', #{address}, '%')
OR a.city LIKE CONCAT('%', #{address}, '%')
OR a.district LIKE CONCAT('%', #{address}, '%')
OR a.stree LIKE CONCAT('%', #{address}, '%')
OR a.community LIKE CONCAT('%', #{address}, '%')
OR a.address LIKE CONCAT('%', #{address}, '%')
)
</if>
<if test="orgName != null and orgName != ''">
AND a.org_name LIKE CONCAT('%', #{orgName}, '%')
</if>
<if test="organizationCode != null and organizationCode != ''">
AND a.organization_code LIKE CONCAT('%', #{organizationCode}, '%')
</if>
</select>
</mapper>
......@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController {
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班
*
* @return ResponseModel
......
......@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate));
}
/**
* 新值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班
*
......
......@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班
*
......
......@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController {
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.statisticsDay(beginDate, endDate));
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-duty-detail")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班
......@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("新查询指定日期值班人信息列表")
@GetMapping("/new-person/{dutyDay}/list")
public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表")
@GetMapping("/person/on_duty/list")
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.Arrays;
import java.util.HashMap;
......@@ -34,7 +34,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
......@@ -91,7 +91,7 @@ public class OrgPersonController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
@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);
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.ContractDto;
import com.yeejoin.amos.boot.module.common.api.entity.Contract;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper;
import com.yeejoin.amos.boot.module.common.api.service.IContractService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -23,10 +16,17 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.ContractDto;
import com.yeejoin.amos.boot.module.common.api.entity.Contract;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper;
import com.yeejoin.amos.boot.module.common.api.service.IContractService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
/**
* 维保合同服务实现类
......@@ -53,8 +53,6 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
MaintenanceCompany company = maintenanceCompanyService.getMaintenanceCompany(amosUserId);
companyId = company.getSequenceNbr();
}
//
Page<ContractDto> resultPage= queryForContractPageByParam(page, isDelete, companyId, signedCompanyId, name, typeCode,
signedDate);
List<ContractDto> resultContractDtos= resultPage.getRecords();
......
......@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) {
continue;
}
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if(dutyList!=null && dutyList.size()>0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if(!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString());
this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---start
//infoMap_1.put(dutyDetail.get("name").toString(), "");
//resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---end
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
......@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
resultList.add(infoMap_2);
}
}
}
}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
// }
//}
}
detailList.add(resultList);
}
......
......@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService;
/**
......@@ -75,6 +76,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
OrgUsrServiceImpl orgUsrService;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
/**
* 每天单个班次执勤人数全部小于等于3人
......@@ -213,7 +217,126 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return resultMap;
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
}
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException {
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin);
Date dateEnd = DateUtils.dateParse(endDate, DateUtils.DATE_PATTERN);
String timeEnd = DateUtils.dateTimeToDateString(dateEnd);
List<String> betweenDate = getBetweenDate(timeStart, timeEnd);
//拿到每一天的视图展示
String beginTime = null;
String endTime = null;
List<Map<String, Object>> viewTypeResult = new ArrayList<>();
for (String time : betweenDate) {
beginTime = time + " 00:00:00";
endTime = time + " 23:59:59";
Map<String, Object> viewTypeMap = new HashMap<>();
viewTypeMap.put("date",time);
viewTypeResult.add(viewTypeMap);
}
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
List<Map<String, Object>> resultMap = new ArrayList<>();
for (Map<String, Object> stringObjectMap : viewTypeResult) {
for (Map<String, Object> objectMap : rangeDate) {
if (stringObjectMap.get("date").equals(objectMap.get("date"))){
Map<String, Object> result = new LinkedHashMap<>();
result.put("key", objectMap.get("date"));
String dateString = objectMap.get("date").toString();
if(this.getGroupCode().equals("dutyPerson")) {
result.put("data", getPersonPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyCar")) {
result.put("data", getCarPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFireFighting")) {
result.put("data", getFireFightingPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFirstAid")) {
result.put("data", getFirstAidPostTypeNameAndCount(dateString));
}
resultMap.add(result);
}
}
}
return resultMap;
}
/**
* 排班值班人员的统计类型为:
* 岗位: 岗位人员数量
* @param dutyDate
* @return
*/
public Object getPersonPostTypeNameAndCount(String dutyDate) {
return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
}
/**
* 车辆值班人员左侧的统计: 只有几辆车
* @param dutyDate
* @return
*/
public Object getCarPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFireFightingPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFirstAidPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) {
List<Map<String, Object>> result = new ArrayList<>();
switch (viewTypeEnum) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
......@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
......@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) {
continue;
}
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if(dutyList!=null && dutyList.size()>0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if(!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString());
this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(dutyDetail.get("name").toString(), "");
// resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
// }
// }
}
}
detailList.add(resultList);
......
......@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
......@@ -18,8 +19,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import ch.qos.logback.core.joran.conditional.IfAction;
@Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
......@@ -67,15 +66,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2.put("单位/部门", map.get("teamName").toString());
}
resultList.add(titleMap_2);
List<Object> resultList = new ArrayList<Object>();
//LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
//titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add( map.get("firstAid").toString());
// LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
// if(map.containsKey("teamName") && map.get("teamName") != null){
// titleMap_2.put("单位/部门", map.get("teamName").toString());
// }
// resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
......@@ -86,22 +85,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if (dutyList != null && dutyList.size() > 0) {
for (Map<String, Object> dutyDetail : dutyList) {
if (!dutyDetail.containsKey("name")) {
continue;
}
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if (dutyList != null && dutyList.size() > 0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if (!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
dutyDetail.get("name").toString());
null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
// LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
// infoMap_1.put(dutyDetail.get("name").toString(), "");
// resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
......@@ -110,9 +109,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
// }
//
// }
}
}
detailList.add(resultList);
......@@ -122,11 +121,21 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
public List< Map<String, Object>> getFirstAidExportData(List<String> ids) {
List< Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
List< Map<String, Object>> result = new ArrayList<Map<String, Object>>();
List<String> userNameList= new ArrayList<String>();
String firstAidCompanyId = dutyPersonShiftMapper.getFirstAidCompanyId();
if (firstAidCompanyId != "" && firstAidCompanyId != null){
ids.add(firstAidCompanyId);
}
List<String> firstAidSimpleList = new ArrayList<String>();
List<String> companyNameList = new ArrayList<String>();
String typeString = "JJZ";
ids.stream().forEach(i->{
Map<String, Object> detailMap = new HashMap<String, Object>();
List<OrgUsr> personList = orgUsrServiceImpl.getPersonListByParentId(Long.parseLong(i));
List<String> userNameList= new ArrayList<String>();
personList.stream().forEach(m -> {
String userNameString =m.getBizOrgName()+ "@" +m.getSequenceNbr();
userNameList.add(userNameString);
......@@ -134,28 +143,38 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
detailMap.put("userName", userNameList);
OrgUsr companyDetail = orgUsrServiceImpl.getDetailById(Long.parseLong(i));
String companyNameString = companyDetail.getBizOrgName()+ "@" +companyDetail.getSequenceNbr();
detailMap.put("companyName", companyNameString);
companyNameList.add(companyNameString);
detailMap.put("companyName", companyNameList);
List<DataDictionary> dataDicList= dataDictionaryService.getByType(typeString);
List<String> dataDicSimpleList = new ArrayList<String>();
dataDicList.stream().forEach(l->{
String dataDic = l.getName() + "@" +l.getCode();
dataDicSimpleList.add(dataDic);
});
dataDicList.stream().forEach(l->{
String dataDic = l.getName() + "@" +l.getCode();
dataDicSimpleList.add(dataDic);
});
detailMap.put("postTypeName",dataDicSimpleList);
List<Map<String, Object>> list = dutyPersonShiftMapper.getFirstAidForTypeCodeAndCompanyId(
Long.parseLong(i));
List<String> firstAidSimpleList = new ArrayList<String>();
list.stream().forEach(m -> {
String firstAidNameString = m.get("name").toString() + "@" + m.get("sequence_nbr").toString();
firstAidSimpleList.add(firstAidNameString);
});
if( firstAidSimpleList != null && firstAidSimpleList.size() > 1 ) {
if( firstAidSimpleList != null && firstAidSimpleList.size() >= 1 ) {
detailMap.put("firstAidName", firstAidSimpleList);
resultList.add(detailMap);
}
resultList.add(detailMap);
});
return resultList;
for (int i = 0; i < resultList.size(); i++) {
if (resultList.get(i).size() == 4){
result.add(resultList.get(i));
}
if (result.size()>0){
break;
}
}
return result;
}
}
......@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("deptName") && map.get("deptName") != null){
resultList.add( map.get("deptName").toString());
}
String carId = map.get("deptId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
detailList.add(resultList);
}
return detailList;
}
......
......@@ -282,9 +282,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto.setFailureCode(buildOrderNo());
String parentId = iOrgUsrService.getParentId(userInfo.getUserModel().getUserId());
if (parentId != null){
failureDetailsDto.setBizCode(Long.valueOf(parentId));
}
OrgUsr orgUsr = iOrgUsrService.getById(parentId);
failureDetailsDto.setBizCode(Long.valueOf(parentId));
model = this.createWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......@@ -320,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
FailureDetailsDto model = this.updateWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......
......@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId());
List<FailureVerify> byfaultId = findByfaultId(failureDetailsDto.getSequenceNbr());
if (byfaultId.size() != 0) {
if (byfaultId.size() != 0 && status.getCode().equals(FailureStatuEnum.FINISH.getCode())) {
failureDetailsDto.setCurrentStatus(status.getCode());
}
if (condition == AuditResultEnum.REFUSE.getCode()){
failureDetailsDto.setCurrentStatus(status.getCode());
}
failureDetailsDto.setSequenceNbr(model.getFaultId());
failureDetailsService.updateWithModel(failureDetailsDto);
......
......@@ -94,6 +94,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "alarmType", required = false) String alarmType,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "buildIds", required = false) List<String> buildIds,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
......@@ -139,6 +141,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9.setName("buildIds");
request9.setValue(ObjectUtils.isEmpty(buildIds) ? null : buildIds);
queryRequests.add(request9);
CommonRequest request10 = new CommonRequest();
request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param);
return CommonResponseUtil.success(list);
......@@ -200,6 +210,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "systemCode", required = false) String systemCode,
@RequestParam(value = "buildId", required = false) String buildId,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) {
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest();
......@@ -235,6 +247,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9.setName("buildId");
request9.setValue(StringUtil.isNotEmpty(buildId) ? StringUtils.trimToNull(buildId) : null);
queryRequests.add(request9);
CommonRequest request10 = new CommonRequest();
request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param);
return CommonResponseUtil.success(list);
......
This diff is collapsed.
This diff is collapsed.
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