bug修复

This commit is contained in:
Administrator 2023-07-06 22:13:14 +08:00
parent bb936b7541
commit 0a4d175176
11 changed files with 86 additions and 29 deletions

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.bimface.client;
import com.alibaba.fastjson.JSONObject;
import com.gexin.fastjson.JSON;
import com.zhgd.xmgl.modules.bigdevice.exceptions.NotAuthException;
import com.zhgd.xmgl.modules.bimface.entity.BimfaceConfig;
import com.zhgd.xmgl.modules.bimface.service.IBimfaceConfigService;
@ -73,11 +74,12 @@ public class BimClient {
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setBearerAuth(getAccessTokenByProjectSn(projectSn));
HttpEntity requestEntity = new HttpEntity<>(requestHeaders);
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(String.format(uploadURL, name, url), HttpMethod.PUT, requestEntity, JSONObject.class);
String u = String.format(uploadURL, name, url);
ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(u, HttpMethod.PUT, requestEntity, JSONObject.class);
JSONObject body = responseEntity.getBody();
log.info("" + body);
log.error("上传文件失败uploadFile err:{}", JSON.toJSONString(body));
if (responseEntity.getStatusCodeValue() != 200 || body == null || !"success".equals(body.getString("code"))) {
log.error("上传文件失败项目sn为{},名称为:{}url为{}", projectSn, name, url);
log.error("上传文件失败项目sn为{},名称为:{}url为{}", projectSn, name, u);
throw new RuntimeException("上传文件失败!名称可能重复或其他原因!");
}
return body.getJSONObject("data").getLong("fileId");

View File

@ -35,7 +35,7 @@ public class LedBigScreenRegion implements Serializable {
*/
@Excel(name = "led大屏id", width = 15)
@ApiModelProperty(value = "led大屏id")
private java.lang.Integer ledBigScreenId;
private java.lang.Long ledBigScreenId;
/**
* 区域内容
*/
@ -106,4 +106,7 @@ public class LedBigScreenRegion implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
@ApiModelProperty(value = "数据模块类型")
private Integer type;
}

View File

@ -26,6 +26,8 @@ import java.util.List;
public class LedBigScreenServiceImpl extends ServiceImpl<LedBigScreenMapper, LedBigScreen> implements ILedBigScreenService {
@Autowired
private LedBigScreenRegionMapper ledBigScreenRegionMapper;
@Autowired
private LedBigScreenMapper ledBigScreenMapper;
@Override
public LedBigScreen queryDetail(HashMap<String, Object> map) {
@ -34,8 +36,10 @@ public class LedBigScreenServiceImpl extends ServiceImpl<LedBigScreenMapper, Led
throw new OpenAlertException("projectSn不能为空");
}
LedBigScreen ledBigScreen = getOne(new LambdaQueryWrapper<LedBigScreen>().eq(LedBigScreen::getProjectSn, projectSn));
List<LedBigScreenRegion> ledBigScreenRegions = ledBigScreenRegionMapper.selectList(new LambdaQueryWrapper<LedBigScreenRegion>().eq(LedBigScreenRegion::getProjectSn, projectSn));
ledBigScreen.setLedBigScreenRegions(ledBigScreenRegions);
if (ledBigScreen != null) {
List<LedBigScreenRegion> ledBigScreenRegions = ledBigScreenRegionMapper.selectList(new LambdaQueryWrapper<LedBigScreenRegion>().eq(LedBigScreenRegion::getProjectSn, projectSn));
ledBigScreen.setLedBigScreenRegions(ledBigScreenRegions);
}
return ledBigScreen;
}
@ -44,13 +48,15 @@ public class LedBigScreenServiceImpl extends ServiceImpl<LedBigScreenMapper, Led
String projectSn = ledBigScreen.getProjectSn();
LedBigScreen lbs = getOne(new LambdaQueryWrapper<LedBigScreen>().eq(LedBigScreen::getProjectSn, projectSn));
if (lbs == null) {
save(ledBigScreen);
ledBigScreenMapper.insert(ledBigScreen);
} else {
updateById(ledBigScreen);
ledBigScreen.setId(lbs.getId());
ledBigScreenMapper.updateById(ledBigScreen);
}
ledBigScreenRegionMapper.delete(new LambdaQueryWrapper<LedBigScreenRegion>().eq(LedBigScreenRegion::getProjectSn, projectSn));
for (LedBigScreenRegion ledBigScreenRegion : ledBigScreen.getLedBigScreenRegions()) {
ledBigScreenRegion.setProjectSn(projectSn);
ledBigScreenRegion.setLedBigScreenId(ledBigScreen.getId());
ledBigScreenRegionMapper.insert(ledBigScreenRegion);
}
}

View File

@ -53,17 +53,21 @@ public class MaterialApproachRecord implements Serializable {
private String manufacturer;
/**
* 车牌号
*/
@Excel(name = "车牌号", width = 15)
@ApiModelProperty(value = "车牌号")
private String licensePlateNumber;
/**
* 进场量
*/
@Excel(name = "进场量", width = 15)
@ApiModelProperty(value = "进场量")
private Double approachVolume;
*/
@Excel(name = "车牌号", width = 15)
@ApiModelProperty(value = "车牌号")
private String licensePlateNumber;
/**
* 进场量
*/
@Excel(name = "进场量", width = 15)
@ApiModelProperty(value = "进场量")
private Double approachVolume;
@ApiModelProperty(value = "出场量")
private Double appearanceVolume;
@ApiModelProperty(value = "净重量")
private Double netWeightVolume;
@ApiModelProperty(value = "projectSn")
private String projectSn;
@ApiModelProperty(value = "projectSn")
private String projectSn;
}

View File

@ -108,9 +108,7 @@ public class ProjectFileController {
@ApiOperation(value = "文件移动", notes = "可以移动文件或者目录", httpMethod = "POST")
@RequestMapping(value = "/batchmovefile", method = RequestMethod.POST)
public Result<String> batchMoveFile(@RequestBody List<ProjectFile> list) {
for (ProjectFile projectFile : list) {
projectFileService.moveFile(projectFile);
}
projectFileService.batchMoveFile(list);
return Result.ok();
}

View File

@ -26,4 +26,6 @@ public interface IProjectFileService extends IService<ProjectFile> {
void moveFile(ProjectFile projectFile);
Result<List<ProjectFile>> getFileList(ProjectFile projectFile, HttpServletRequest request);
void batchMoveFile(List<ProjectFile> list);
}

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.project.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.api.vo.Result;
@ -141,4 +142,29 @@ public class ProjectFileServiceImpl extends ServiceImpl<ProjectFileMapper, Proje
List<ProjectFile> list = list(queryWrapper);
return Result.success(list);
}
@Override
public void batchMoveFile(List<ProjectFile> list) {
checkParam(list);
for (ProjectFile projectFile : list) {
moveFile(projectFile);
}
}
private void checkParam(List<ProjectFile> list) {
if (CollectionUtil.isEmpty(list)) {
throw new OpenAlertException("未选中需要移动的文件");
}
ProjectFile old = projectFileMapper.selectById(list.get(0).getFileId());
if (list.stream().anyMatch(e -> (e.getFilePath() + e.getFileName()).equals(old.getFilePath() + old.getFileName()))) {
throw new OpenAlertException("目标文件夹和源文件夹相同");
}
if (list.stream().anyMatch(e -> {
String source = e.getFilePath() + e.getFileName();
String target = old.getFilePath() + old.getFileName();
return source.equals(target);
})) {
throw new OpenAlertException("目标文件夹是源文件夹的子文件夹");
}
}
}

View File

@ -148,9 +148,10 @@
<select id="selectProjectVideoList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
SELECT t1.*, t2.*, t1.video_name name
FROM video_item t1
INNER JOIN project_video_config t2 ON t2.id = t1.video_id
INNER JOIN project_video_config t2 ON t2.id = t1.video_id
WHERE t2.is_enable = 1
and t2.project_sn = #{projectSn}
and t2.project_sn = #{projectSn}
order by t1.sort_num
</select>
<select id="selectUserVideoList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT t1.*, t2.*, t1.video_name name
@ -298,4 +299,4 @@
FROM video_item t1
INNER JOIN project_video_config t2 ON t2.id = t1.video_id
</select>
</mapper>
</mapper>

View File

@ -2352,7 +2352,18 @@
count(wi.id) AS num
FROM worker_type wt
LEFT JOIN team_info ti ON wt.id = ti.worker_type_id
LEFT JOIN worker_info wi ON (ti.id = wi.team_id and wi.inService_type = 1)
LEFT JOIN worker_info wi ON (ti.id = wi.team_id and wi.inService_type = 1
<if test="projectSn != null and projectSn != ''">
and wi.project_sn = #{projectSn}
</if>
<if test="projectSnList != null and projectSnList != ''">
and wi.project_sn in
<foreach collection="projectSnList" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
)
where 1=1
<if test="projectSn != null and projectSn != ''">
and wt.project_sn = #{projectSn}

View File

@ -142,8 +142,9 @@
FROM project p
LEFT JOIN (SELECT DISTINCT wp.project_sn
FROM worker_wages_payment wp
JOIN project p1
JOIN project p1 on wp.project_sn=p1.project_sn
where wp.pay_month = #{param.payMonth}) t ON t.project_sn = p.project_sn
where 1=1
<if test="projectSnList != null and projectSnList != ''">
and p.project_sn in
<foreach collection="projectSnList" item="item" index="index"
@ -167,5 +168,8 @@
#{item}
</foreach>
</if>
<if test="projectSn != null and projectSn != ''">
and a.project_sn = #{projectSn}
</if>
</select>
</mapper>

View File

@ -22,7 +22,7 @@ mqtt.producer.defaultTopic=topic1
mqtt.consumer.clientId=mqttConsumer
mqtt.consumer.defaultTopic=topic1
mqtt-scope=prodTopic
serverUrl=http://124.71.178.44:8
serverUrl=http://192.168.34.221:12350
#\u89C6\u9891\u5206\u6790url
video-analysis-url=
#\u9ED8\u8BA4\u653F\u52A1\u521B\u5EFA\u9879\u76EE\u6240\u5C5E\u4F01\u4E1A