bug修复
This commit is contained in:
parent
8bcbb1ebce
commit
1babfb30d2
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.car.controller;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.car.entity.CarPassRecord;
|
||||
@ -153,6 +154,8 @@ public class CarPassRecordController {
|
||||
log.info(JSONUtil.toJsonStr(data));
|
||||
} else if ("offline".equals(type)) {
|
||||
Map<String, Object> resultMap = carPassRecordService.saveCameraCarPassRecord(plate_num, car_logo, car_color, park_id, cam_id, vdc_type, picture, closeup_pic);
|
||||
data.put("error_num", 0);
|
||||
data.put("error_str", "not error");
|
||||
} else if ("heartbeat".equals(type)) {
|
||||
//log.info("车牌心跳" + "车场ID:" + park_id + "相机ID:" + cam_id);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
@ -376,7 +376,7 @@
|
||||
IFNULL(SUM((IF(status = 1 or status = 4, 1, 0))), 0) allRectificationNum,
|
||||
IFNULL(SUM((IF(!(status = 1 or status = 4) or status is null, 1, 0))),
|
||||
0) allNoRectificationNum,
|
||||
IFNULL(SUM((IF(YEARWEEK(inspect_time, 1) = YEARWEEK(now(), 7), 1, 0))),
|
||||
IFNULL(SUM((IF(YEARWEEK(inspect_time, 1) = YEARWEEK(now(), 1), 1, 0))),
|
||||
0) weekTotalNum
|
||||
from hidden_danger_inspection_record
|
||||
WHERE project_sn = #{projectSn}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
|
||||
@ -94,6 +95,20 @@ public class QualityInspectionRecordController {
|
||||
return Result.success(qualityInspectionRecordService.getQualityAcceptanceAndRectificationNum(projectSn));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取质量巡检本周和所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取质量巡检本周和所有数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
})
|
||||
@GetMapping(value = "/getQualityAcceptanceAndRectificationNumThisWeek")
|
||||
public Result<AllAndThisWeekDataVO> getQualityAcceptanceAndRectificationNumThisWeek(String projectSn) {
|
||||
return Result.success(qualityInspectionRecordService.getQualityAcceptanceAndRectificationNumThisWeek(projectSn));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分部分项获取对应质量巡检
|
||||
*
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.zhgd.xmgl.modules.quality.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(value = "AllAndWeekDataVO对象", description = "质量巡检本周和所有数据")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AllAndThisWeekDataVO extends AllDataVO {
|
||||
@ApiModelProperty(value = "本周巡检总数")
|
||||
private Long weekTotal;
|
||||
|
||||
@ApiModelProperty(value = "本周已闭合")
|
||||
private Long weekClose;
|
||||
|
||||
@ApiModelProperty(value = "本周未闭合")
|
||||
private Long weekNoClose;
|
||||
|
||||
@ApiModelProperty(value = "本周已闭合占比")
|
||||
private Double weekCloseRatio;
|
||||
|
||||
@ApiModelProperty(value = "本周未闭合占比")
|
||||
private Double weekNoCloseRatio;
|
||||
}
|
||||
@ -21,4 +21,16 @@ import lombok.NoArgsConstructor;
|
||||
public class AllAndWeekDataVO extends AllDataVO {
|
||||
@ApiModelProperty(value = "本周巡检总数")
|
||||
private Long weekTotal;
|
||||
|
||||
@ApiModelProperty(value = "本周已闭合")
|
||||
private Long weekClose;
|
||||
|
||||
@ApiModelProperty(value = "本周未闭合")
|
||||
private Long weekNoClose;
|
||||
|
||||
@ApiModelProperty(value = "本周已闭合占比")
|
||||
private Double weekCloseRatio;
|
||||
|
||||
@ApiModelProperty(value = "本周未闭合占比")
|
||||
private Double weekNoCloseRatio;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -40,4 +41,6 @@ public interface QualityInspectionRecordMapper extends BaseMapper<QualityInspect
|
||||
AllAndTodayDataVO getQualityAcceptanceAndRectificationNum(@Param("projectSn") String projectSn);
|
||||
|
||||
AllAndWeekDataVO getAllAndWeekData(String projectSn);
|
||||
|
||||
AllAndThisWeekDataVO getQualityAcceptanceAndRectificationNumThisWeek(String projectSn);
|
||||
}
|
||||
|
||||
@ -336,6 +336,22 @@
|
||||
from quality_inspection_record a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
</select>
|
||||
<select id="getQualityAcceptanceAndRectificationNumThisWeek"
|
||||
resultType="com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO">
|
||||
select
|
||||
<!-- 所有 -->
|
||||
COUNT(1) allTotal,
|
||||
<!-- 所有未闭合 -->
|
||||
IFNULL(SUM((IF(a.status != 5, 1, 0))), 0) allNoClose,
|
||||
<!-- 所有已闭合 -->
|
||||
IFNULL(SUM((IF(a.status = 5, 1, 0))), 0) allClose,
|
||||
<!-- 本周未闭合 -->
|
||||
IFNULL(SUM((IF(YEARWEEK( a.inspect_time, 1 ) = YEARWEEK( now(), 1 ) and a.status != 5, 1, 0))), 0) weekNoClose,
|
||||
<!-- 本周已闭合 -->
|
||||
IFNULL(SUM((IF(YEARWEEK( a.inspect_time, 1 ) = YEARWEEK( now(), 1 ) and a.status = 5, 1, 0))), 0) weekClose
|
||||
from quality_inspection_record a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
</select>
|
||||
|
||||
<select id="getAllAndWeekData" resultType="com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO">
|
||||
select
|
||||
@ -346,7 +362,11 @@
|
||||
<!-- 所有已闭合 -->
|
||||
IFNULL(SUM((IF(a.status = 5, 1, 0))), 0) allClose,
|
||||
<!-- 本周总数 -->
|
||||
IFNULL(SUM((IF(YEARWEEK(a.inspect_time, 1) = YEARWEEK(now(), 7), 1, 0))), 0) weekTotal
|
||||
IFNULL( SUM(( IF ( YEARWEEK( a.inspect_time, 1 ) = YEARWEEK( now(), 1 ), 1, 0 ))), 0 ) weekTotal,
|
||||
<!-- 本周未闭合 -->
|
||||
IFNULL(SUM((IF(YEARWEEK( a.inspect_time, 1 ) = YEARWEEK( now(), 1 ) and a.status != 5, 1, 0))), 0) weekNoClose,
|
||||
<!-- 本周已闭合 -->
|
||||
IFNULL(SUM((IF(YEARWEEK( a.inspect_time, 1 ) = YEARWEEK( now(), 1 ) and a.status = 5, 1, 0))), 0) weekClose
|
||||
from quality_inspection_record a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
</select>
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.quality.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
|
||||
@ -38,6 +39,8 @@ public interface IQualityInspectionRecordService extends IService<QualityInspect
|
||||
|
||||
AllAndTodayDataVO getQualityAcceptanceAndRectificationNum(String projectSn);
|
||||
|
||||
AllAndThisWeekDataVO getQualityAcceptanceAndRectificationNumThisWeek(String projectSn);
|
||||
|
||||
AllAndWeekDataVO getAllAndWeekData(String projectSn);
|
||||
|
||||
List<QualityInspectionRecord> limitListBySubdivision(String projectSn, Long subsectionId, Long subentryId, Integer size);
|
||||
|
||||
@ -11,6 +11,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityRectifyRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllDataVO;
|
||||
@ -203,10 +204,19 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
|
||||
return allAndTodayDataVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AllAndThisWeekDataVO getQualityAcceptanceAndRectificationNumThisWeek(String projectSn) {
|
||||
AllAndThisWeekDataVO vo = qualityInspectionRecordMapper.getQualityAcceptanceAndRectificationNumThisWeek(projectSn);
|
||||
setAllRatio(vo);
|
||||
setWeekRatio(vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AllAndWeekDataVO getAllAndWeekData(String projectSn) {
|
||||
AllAndWeekDataVO allAndWeekDataVO = qualityInspectionRecordMapper.getAllAndWeekData(projectSn);
|
||||
setAllRatio(allAndWeekDataVO);
|
||||
setWeekRatioData(allAndWeekDataVO);
|
||||
return allAndWeekDataVO;
|
||||
}
|
||||
|
||||
@ -221,6 +231,24 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
|
||||
return qualityInspectionRecordMapper.selectPage(new Page<>(1, size), wrapper).getRecords();
|
||||
}
|
||||
|
||||
private void setWeekRatioData(AllAndWeekDataVO allAndWeekDataVO) {
|
||||
long weekClose = allAndWeekDataVO.getWeekClose();
|
||||
long weekNoClose = allAndWeekDataVO.getWeekNoClose();
|
||||
long l = weekClose + weekNoClose;
|
||||
allAndWeekDataVO.setWeekCloseRatio(l != 0 ? NumberUtil.div(NumberUtil.mul(weekClose, 100), l, 2) : 0);
|
||||
allAndWeekDataVO.setWeekNoCloseRatio(l != 0 ? NumberUtil.div(NumberUtil.mul(weekNoClose, 100), l, 2) : 0);
|
||||
allAndWeekDataVO.setWeekTotal(l);
|
||||
}
|
||||
|
||||
private void setWeekRatio(AllAndThisWeekDataVO allAndThisWeekDataVO) {
|
||||
long weekClose = allAndThisWeekDataVO.getWeekClose();
|
||||
long weekNoClose = allAndThisWeekDataVO.getWeekNoClose();
|
||||
long l = weekClose + weekNoClose;
|
||||
allAndThisWeekDataVO.setWeekCloseRatio(l != 0 ? NumberUtil.div(NumberUtil.mul(weekClose, 100), l, 2) : 0);
|
||||
allAndThisWeekDataVO.setWeekNoCloseRatio(l != 0 ? NumberUtil.div(NumberUtil.mul(weekNoClose, 100), l, 2) : 0);
|
||||
allAndThisWeekDataVO.setWeekTotal(l);
|
||||
}
|
||||
|
||||
private void setTodayRatio(AllAndTodayDataVO allAndTodayDataVO) {
|
||||
long todayClose = allAndTodayDataVO.getTodayClose();
|
||||
long todayNoClose = allAndTodayDataVO.getTodayNoClose();
|
||||
|
||||
@ -163,7 +163,7 @@ public class SecurityManageController {
|
||||
return Result.success(securityManageService.selectRectifiedSecurityManageList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询最新20条待整改的安全管理数据", notes = "查询最新一条待整改的安全管理数据" , httpMethod="POST")
|
||||
@ApiOperation(value = "查询待整改的安全管理数据", httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
|
||||
@ -74,7 +74,6 @@
|
||||
where a.project_sn=#{projectSn}
|
||||
and a.state=1
|
||||
order by a.create_time desc
|
||||
LIMIT 20
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -7,6 +7,9 @@
|
||||
from department_info a LEFT JOIN
|
||||
(SELECT department_id,COUNT(1) worker_num FROM worker_info
|
||||
WHERE project_sn=#{projectSn}
|
||||
<if test="personType != null and personType != ''">
|
||||
and person_type = #{personType}
|
||||
</if>
|
||||
GROUP BY department_id
|
||||
) b ON a.id=b.department_id
|
||||
WHERE a.project_sn=#{projectSn}
|
||||
|
||||
@ -39,29 +39,37 @@ public class JxjNewUfaceDevUtil {
|
||||
}
|
||||
|
||||
public static void addOrUpdatePerson(WorkerInfo workerInfo, ProjectUfaceConfig projectUfaceConfig,String basePath,String deviceKeys,Integer jxjDevImageType) {
|
||||
JSONObject jsonObject=new JSONObject();
|
||||
jsonObject.put("personName",workerInfo.getWorkerName());
|
||||
jsonObject.put("projectId",projectUfaceConfig.getAppId());
|
||||
jsonObject.put("personSn",workerInfo.getPersonSn());
|
||||
if(StringUtils.isNotEmpty(workerInfo.getFieldAcquisitionUrl())&&workerInfo.getFieldAcquisitionUrl().startsWith("http")){
|
||||
if(jxjDevImageType==2){
|
||||
jsonObject.put("image",workerInfo.getFieldAcquisitionUrl());
|
||||
}else{
|
||||
jsonObject.put("image",Base64Util.getFileToBase64(workerInfo.getFieldAcquisitionUrl()));
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("personName", workerInfo.getWorkerName());
|
||||
jsonObject.put("projectId", projectUfaceConfig.getAppId());
|
||||
jsonObject.put("personSn", workerInfo.getPersonSn());
|
||||
if (StringUtils.isNotEmpty(workerInfo.getFieldAcquisitionUrl()) && workerInfo.getFieldAcquisitionUrl().startsWith("http")) {
|
||||
if (jxjDevImageType == 2) {
|
||||
jsonObject.put("image", workerInfo.getFieldAcquisitionUrl());
|
||||
} else {
|
||||
jsonObject.put("image", Base64Util.getFileToBase64(workerInfo.getFieldAcquisitionUrl()));
|
||||
}
|
||||
|
||||
}else{
|
||||
if(jxjDevImageType==2){
|
||||
jsonObject.put("image",workerInfo.getFieldAcquisitionUrl());
|
||||
}else{
|
||||
jsonObject.put("image",Base64Util.getFileToBase64(basePath+"/"+workerInfo.getFieldAcquisitionUrl()));
|
||||
} else {
|
||||
if (jxjDevImageType == 2) {
|
||||
jsonObject.put("image", workerInfo.getFieldAcquisitionUrl());
|
||||
} else {
|
||||
jsonObject.put("image", Base64Util.getFileToBase64(basePath + "/" + workerInfo.getFieldAcquisitionUrl()));
|
||||
}
|
||||
}
|
||||
jsonObject.put("idNum",workerInfo.getIdCard());
|
||||
jsonObject.put("cardNum",workerInfo.getAttendanceNumber());
|
||||
jsonObject.put("deviceKeys",deviceKeys);
|
||||
String result=HttpUtil.post(projectUfaceConfig.getServiceUrl()+"/api/person/addOrUpdatePerson",jsonObject.toString());
|
||||
log.info("-----新JXJ设备添加或编辑人员结果:"+result);
|
||||
jsonObject.put("idNum", workerInfo.getIdCard());
|
||||
jsonObject.put("cardNum", workerInfo.getAttendanceNumber());
|
||||
jsonObject.put("deviceKeys", deviceKeys);
|
||||
String url = projectUfaceConfig.getServiceUrl() + "/api/person/addOrUpdatePerson";
|
||||
String body = jsonObject.toString();
|
||||
log.info("url:{},body:{}", url, body);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpUtil.post(url, body);
|
||||
} catch (Exception e) {
|
||||
log.error("err:", e);
|
||||
}
|
||||
log.info("-----新JXJ设备添加或编辑人员结果:" + result);
|
||||
}
|
||||
|
||||
public static void deleteWorkerInfo(WorkerInfo workerInfo, ProjectUfaceConfig projectUfaceConfig) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user