diff --git a/pom.xml b/pom.xml
index 8c64afcb3..e4acf9535 100644
--- a/pom.xml
+++ b/pom.xml
@@ -995,7 +995,7 @@
wflow-server-1.0-SNAPSHOT.jar
- B67960E5E329F6DD23AFFA354E12732BD41D8CD98F00B204E9800998ECF8427ED41D8CD98F00B204E9800998ECF8427E
+ E41FF860D014DCAA9F4FB3020D4C9050D41D8CD98F00B204E9800998ECF8427ED41D8CD98F00B204E9800998ECF8427E
diff --git a/src/main/java/com/zhgd/xmgl/modules/project/entity/Project.java b/src/main/java/com/zhgd/xmgl/modules/project/entity/Project.java
index c5e5cc335..ea879027e 100644
--- a/src/main/java/com/zhgd/xmgl/modules/project/entity/Project.java
+++ b/src/main/java/com/zhgd/xmgl/modules/project/entity/Project.java
@@ -325,8 +325,8 @@ public class Project implements Serializable {
private Integer enableWorkerSafeWatch;
@ApiModelProperty(value = "安全履职报警推送时间")
private String workerSafeWatchTime;
- @ApiModelProperty(value = "是否需要项目管理员做AI抓拍初筛")
- private Integer aiAlarmNeedManageApprove;
+
+
/**
* runde平台token
*/
diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/entity/QualityRectifyRecord.java b/src/main/java/com/zhgd/xmgl/modules/quality/entity/QualityRectifyRecord.java
index 708071b96..d223ef69f 100644
--- a/src/main/java/com/zhgd/xmgl/modules/quality/entity/QualityRectifyRecord.java
+++ b/src/main/java/com/zhgd/xmgl/modules/quality/entity/QualityRectifyRecord.java
@@ -82,7 +82,7 @@ public class QualityRectifyRecord implements Serializable {
*/
@Excel(name = "违章人员", width = 15)
@ApiModelProperty(value = "违章人员")
- private String violatorId;
+ private Long violatorId;
@TableField(exist = false)
private String realName;
diff --git a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java
index d7a4ab420..357ac99ad 100644
--- a/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java
+++ b/src/main/java/com/zhgd/xmgl/modules/quality/service/impl/QualityRectifyRecordServiceImpl.java
@@ -18,6 +18,7 @@ import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.redis.lock.redisson.RedissonDistributedLock;
import com.zhgd.xmgl.call.SanjiangDataCall;
import com.zhgd.xmgl.constant.Cts;
+import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
@@ -39,6 +40,7 @@ import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
+import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
import com.zhgd.xmgl.push.config.PushPayloads;
import com.zhgd.xmgl.util.TimeUtil;
import org.apache.commons.collections.CollectionUtils;
@@ -214,36 +216,34 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl map = new HashMap<>(16);
- map.put("id", workerInfo.getId());
- map.put("deductScore", ds);
- workerInfoService.updateScoreSendAuth(map);
-
-
- //存记录
- XzDeductScoreRecord vo = new XzDeductScoreRecord();
- vo.setProjectSn(qualityInspectionRecord.getProjectSn());
- vo.setWorkerId(workerInfo.getId());
- vo.setTypeName(item.getContent());
- vo.setDeductScore(-item.getDeductScore());
- vo.setType(3);
- vo.setCreateDate(new Date());
- vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
- vo.setDeductReason(StrUtil.format("您在{}发现质量隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "质量检査", vo.getTypeName() == null ? "无" : vo.getTypeName(), item.getDeductScore()));
- vo.setTypeTableId(qualityInspectionRecord.getId());
- xzDeductScoreRecordMapper.insert(vo);
+ WorkerInfo workerInfo = workerInfoMapper.selectById(changeUser);
+ if (workerInfo == null) {
+ return;
}
+
+ //扣分
+ HashMap map = new HashMap<>(16);
+ map.put("id", workerInfo.getId());
+ map.put("deductScore", ds);
+ workerInfoService.updateScoreSendAuth(map);
+
+
+ //存记录
+ XzDeductScoreRecord vo = new XzDeductScoreRecord();
+ vo.setProjectSn(qualityInspectionRecord.getProjectSn());
+ vo.setWorkerId(workerInfo.getId());
+ vo.setTypeName(item.getContent());
+ vo.setDeductScore(-item.getDeductScore());
+ vo.setType(3);
+ vo.setCreateDate(new Date());
+ vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
+ vo.setDeductReason(StrUtil.format("您在{}发现质量隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "质量检査", vo.getTypeName() == null ? "无" : vo.getTypeName(), item.getDeductScore()));
+ vo.setTypeTableId(qualityInspectionRecord.getId());
+ xzDeductScoreRecordMapper.insert(vo);
}
diff --git a/src/main/java/com/zhgd/xmgl/modules/video/service/impl/AiAnalyseHardWareAlarmRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/video/service/impl/AiAnalyseHardWareAlarmRecordServiceImpl.java
index d2dde6474..9acf15250 100644
--- a/src/main/java/com/zhgd/xmgl/modules/video/service/impl/AiAnalyseHardWareAlarmRecordServiceImpl.java
+++ b/src/main/java/com/zhgd/xmgl/modules/video/service/impl/AiAnalyseHardWareAlarmRecordServiceImpl.java
@@ -35,7 +35,6 @@ import com.zhgd.xmgl.modules.basicdata.service.impl.NoticeServiceImpl;
import com.zhgd.xmgl.modules.project.entity.Project;
import com.zhgd.xmgl.modules.project.entity.ProjectJqmDev;
import com.zhgd.xmgl.modules.project.entity.vo.ProjectInfoExtVo;
-import com.zhgd.xmgl.modules.project.service.IProjectConfigService;
import com.zhgd.xmgl.modules.project.service.IProjectService;
import com.zhgd.xmgl.modules.project.service.ProjectJqmDevService;
import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareAlarmRecord;
@@ -134,11 +133,6 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl queryAiAnalyseHardWareAlarmPageList(Map map) {
@@ -258,9 +252,6 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(UserEnterprise::getUserId, userId);
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java
index bd5e179ad..0364875c2 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java
@@ -11,8 +11,8 @@ import com.zhgd.xmgl.modules.xz.entity.vo.SafetyTypeScore;
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyTypeScoreVo;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecord;
+import com.zhgd.xmgl.modules.xz.security.entity.vo.FiveScore;
import com.zhgd.xmgl.modules.xz.security.entity.vo.FiveScoresVo;
-import com.zhgd.xmgl.modules.xz.security.entity.vo.TenScore;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityQualityInspectionRecordVo;
import com.zhgd.xmgl.modules.xz.security.enums.TenSafetyTypeEnum;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerItemRecordService;
@@ -67,32 +67,58 @@ public class SafetyInspectionStandardBigScreenController {
SafetyTypeScoreVo thisMonthScoreVo = this.getScores(new MapBuilder().put("projectSn", projectSn).put("month", DateUtil.format(new Date(), "yyyy-MM")).build()).getResult();
SafetyTypeScoreVo lastMonthScoreVo = this.getScores(new MapBuilder().put("projectSn", projectSn).put("month", DateUtil.format(DateUtil.offsetMonth(new Date(), -1), "yyyy-MM")).build()).getResult();
List safetyTypeScores = thisMonthScoreVo.getSafetyTypeScores();
- TenScore tenScore = new TenScore();
+ FiveScore fiveScore = new FiveScore();
+ Map> fiveTypeScoreMap = new HashMap<>(16);
+ //5种:1安全管理、2文明施工、3施工支具【脚手架、模版支架】、4工程器械【物料提升机与施工升降机、塔式起重吊装、施工用具】、5危险作业【基坑工程、高处作业、施工用电】
for (SafetyTypeScore safetyTypeScore : safetyTypeScores) {
- BigDecimal score = safetyTypeScore.getScore();
+ int fiveType;
if (Objects.equals(safetyTypeScore.getTenType(), 1)) {
- tenScore.setAqgl(score);
+ fiveType = 1;
} else if (Objects.equals(safetyTypeScore.getTenType(), 2)) {
- tenScore.setWmsg(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 3)) {
- tenScore.setJsj(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 4)) {
- tenScore.setGczy(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 5)) {
- tenScore.setJkgc(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 6)) {
- tenScore.setMbzj(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 7)) {
- tenScore.setSgyd(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 8)) {
- tenScore.setWltsj(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 9)) {
- tenScore.setTsqzj(score);
- } else if (Objects.equals(safetyTypeScore.getTenType(), 10)) {
- tenScore.setSgjj(score);
+ fiveType = 2;
+ } else if (Objects.equals(safetyTypeScore.getTenType(), 3)
+ || Objects.equals(safetyTypeScore.getTenType(), 6)
+ ) {
+ fiveType = 3;
+ } else if (Objects.equals(safetyTypeScore.getTenType(), 8)
+ || Objects.equals(safetyTypeScore.getTenType(), 9)
+ || Objects.equals(safetyTypeScore.getTenType(), 10)
+ ) {
+ fiveType = 4;
+ } else {
+ fiveType = 5;
+ }
+ List typeScores = fiveTypeScoreMap.get(fiveType);
+ if (typeScores == null) {
+ typeScores = new ArrayList<>();
+ }
+ typeScores.add(safetyTypeScore);
+ fiveTypeScoreMap.putIfAbsent(fiveType, typeScores);
+ }
+ for (Map.Entry> entry : fiveTypeScoreMap.entrySet()) {
+ List list = entry.getValue();
+ if (list.size() == 0) {
+ continue;
+ }
+ BigDecimal score = list.stream().map(SafetyTypeScore::getScore).reduce(BigDecimal.ZERO, BigDecimal::add);
+ switch (entry.getKey()) {
+ case 1:
+ fiveScore.setAqgl(score);
+ break;
+ case 2:
+ fiveScore.setWmsg(score);
+ break;
+ case 3:
+ fiveScore.setSgzj(score);
+ break;
+ case 4:
+ fiveScore.setGcqx(score);
+ break;
+ default:
+ fiveScore.setWxzy(score);
}
}
- vo.setThisMonthScores(tenScore);
+ vo.setThisMonthScores(fiveScore);
vo.setMonthScore(thisMonthScoreVo.getScore());
vo.setLastMonthScore(lastMonthScoreVo.getScore());
vo.setDifferScoreRate(vo.getLastMonthScore().compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : vo.getMonthScore().subtract(vo.getLastMonthScore()).divide(vo.getLastMonthScore(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP));
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzSupplierQualificationApplyController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzSupplierQualificationApplyController.java
index 44165dace..6b9725d57 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzSupplierQualificationApplyController.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzSupplierQualificationApplyController.java
@@ -1,39 +1,11 @@
package com.zhgd.xmgl.modules.xz.controller;
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
-import com.zhgd.jeecg.common.execption.OpenAlertException;
-import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
-import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
-import com.zhgd.xmgl.modules.basicdata.service.impl.NoticeServiceImpl;
-import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
-import com.zhgd.xmgl.modules.project.service.impl.ProjectEnterpriseServiceImpl;
-import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
-import com.zhgd.xmgl.modules.worker.entity.EnterpriseQualification;
-import com.zhgd.xmgl.modules.worker.entity.ProjectEnterpriseSupplierInfo;
-import com.zhgd.xmgl.modules.worker.service.IProjectEnterpriseSupplierInfoService;
-import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
-import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseQualificationServiceImpl;
import com.zhgd.xmgl.modules.xz.entity.XzSupplierQualificationApply;
-import com.zhgd.xmgl.modules.xz.entity.XzSupplierQualificationRecord;
-import com.zhgd.xmgl.modules.xz.entity.XzSupplierRecord;
import com.zhgd.xmgl.modules.xz.entity.vo.XzSupplierQualificationApplyDto;
import com.zhgd.xmgl.modules.xz.service.IXzSupplierQualificationApplyService;
-import com.zhgd.xmgl.modules.xz.service.IXzSupplierQualificationRecordService;
-import com.zhgd.xmgl.modules.xz.service.impl.XzSupplierRecordServiceImpl;
-import com.zhgd.xmgl.security.JwtTokenProvider;
-import com.zhgd.xmgl.util.EmailUtils;
-import com.zhgd.xmgl.util.FlowUtil;
-import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -42,15 +14,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.simpleframework.xml.core.Validate;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
-import java.util.*;
-import java.util.stream.Collectors;
+import java.util.HashMap;
+import java.util.List;
/**
@@ -65,43 +33,8 @@ import java.util.stream.Collectors;
@Slf4j
@Api(tags = "星纵-承包商-入场申请相关Api")
public class XzSupplierQualificationApplyController {
- @Lazy
- @Autowired
- IProjectEnterpriseSupplierInfoService projectEnterpriseSupplierInfoService;
- @Lazy
- @Autowired
- IXzSupplierQualificationRecordService xzSupplierQualificationRecordService;
- @Lazy
- @Autowired
- XzSupplierRecordServiceImpl xzSupplierRecordService;
- @Lazy
- @Autowired
- NoticeServiceImpl noticeService;
- @Lazy
- @Autowired
- ProjectEnterpriseServiceImpl projectEnterpriseService;
- @Lazy
- @Autowired
- private EnterpriseQualificationServiceImpl enterpriseQualificationService;
@Autowired
private IXzSupplierQualificationApplyService xzSupplierQualificationApplyService;
- @Lazy
- @Autowired
- private EnterpriseInfoServiceImpl enterpriseInfoService;
- @Lazy
- @Autowired
- private EmailUtils emailUtils;
- @Lazy
- @Autowired
- private ISystemUserService systemUserService;
- @Lazy
- @Autowired
- private AuthenticationManager authenticationManager;
- @Lazy
- @Autowired
- private JwtTokenProvider jwtTokenProvider;
- @Value("${supplierResubmitApplicationUrl}")
- private String supplierResubmitApplicationUrl;
/**
* 分页列表查询
@@ -203,263 +136,6 @@ public class XzSupplierQualificationApplyController {
return Result.ok();
}
- @OperLog(operModul = "承包商-入场申请管理", operType = "编辑", operDesc = "工作流保存承包商-入场申请")
- @ApiOperation(value = "工作流保存星纵-承包商-入场申请信息", notes = "工作流保存星纵-承包商-入场申请信息", httpMethod = "POST")
- @PostMapping(value = "/flow/saveInfo")
- public Result saveInfoFromFlow(@RequestBody Map map) {
- String paramStr = JSON.toJSONString(map);
- log.info("工作流保存星纵承包商入场申请信息:{}", paramStr);
- String instanceId = MapUtils.getString(map, "instanceId");
- String title = "承包商入场申请";
- try {
- String enterpriseName = MapUtils.getString(map, "enterpriseName");
- String description = MapUtils.getString(map, "description");
- String enterpriseAddress = MapUtils.getString(map, "enterpriseAddress");
- String enterpriseLegalPerson = MapUtils.getString(map, "enterpriseLegalPerson");
- String legalPersonIdCard = MapUtils.getString(map, "legalPersonIdCard");
- String enterpriseSafeAllow = MapUtils.getString(map, "enterpriseSafeAllow");
- String legalPersonTel = MapUtils.getString(map, "legalPersonTel");
- String socialCode = MapUtils.getString(map, "socialCode");
- String businessNumber = MapUtils.getString(map, "businessNumber");
- String qualificationNumber = MapUtils.getString(map, "qualificationNumber");
- String enterpriseEmail = MapUtils.getString(map, "enterpriseEmail");
- String registeredCapital = MapUtils.getString(map, "registeredCapital");
- String bankname = MapUtils.getString(map, "bankname");
- String bankcardnumber = MapUtils.getString(map, "bankcardnumber");
- String bankcode = MapUtils.getString(map, "bankcode");
- String enterpriseQualificationUrl = FlowUtil.getFileUrlWithHost(map, "enterpriseQualificationUrl");
- String businessLicenseEndDate = MapUtils.getString(map, "businessLicenseEndDate");
- String registerPersonName = MapUtils.getString(map, "registerPersonName");
- String registerPersonPhoneTel = MapUtils.getString(map, "registerPersonPhoneTel");
- String enterpriseSn = MapUtils.getString(map, "enterpriseSn");
- String logo = FlowUtil.getFileUrl(map, "logo");
- String registDate = MapUtils.getString(map, "registDate");
- String businessLicenseUrl = FlowUtil.getFileUrl(map, "businessLicenseUrl");
- String projectDirectorName = MapUtils.getString(map, "projectDirectorName");
- String projectDirectorPhone = MapUtils.getString(map, "projectDirectorPhone");
- String projectSn = MapUtils.getString(map, "projectSn");
- String noticeEmail = MapUtils.getString(map, "noticeEmail");
- String ancestors = MapUtils.getString(map, "ancestors");
- Long enterpriseTypeId = Optional.ofNullable(map.get("enterpriseTypeId")).map(o -> Convert.toLong(((List) o).get(0))).orElse(null);
- Long parentEnterpriseId = FlowUtil.getPullDownLong(map, "parentEnterpriseId");
- Integer enterpriseProperty = Optional.ofNullable(map.get("enterpriseProperty")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Integer applyStatus = MapUtils.getInteger(map, "applyStatus");
- String applyContent = Optional.ofNullable(map.get("applyContent")).map(o -> StrUtil.join(",", ((List) o).stream().map(o1 -> JSON.parseObject(o1.toString()).getString("text")).collect(Collectors.toList()))).orElse(null);
- String applyUser = Optional.ofNullable(map.get("applyUser")).map(o -> {
- List users = systemUserService.list(new LambdaQueryWrapper().in(SystemUser::getUserId, ((List) o).stream().distinct().collect(Collectors.toList())));
- if (CollUtil.isEmpty(users)) {
- return "";
- }
- return StrUtil.join(",", users.stream().map(SystemUser::getRealName).collect(Collectors.toList()));
- }).orElse("");
-
-// XzSupplierQualificationApply apply = new XzSupplierQualificationApply();
-// apply.setApplyTime(new Date());
-// apply.setProjectSn(projectSn);
-// apply.setReplyTime(new Date());
-// apply.setApplyStatus(applyStatus);
-// apply.setApplyUser(applyUser);
-// apply.setApplyContent(applyContent);
-// apply.setNoticeEmail(noticeEmail);
-// xzSupplierQualificationApplyService.add(apply);
- String sub = enterpriseName + "(信用代码:" + socialCode + ")";
-
- List enterpriseSupplierInfos = Optional.ofNullable(map.get("enterpriseSupplierInfos")).map(o -> ((List) o)).orElse(null);
- List qualificationRecords = Optional.ofNullable(map.get("qualificationRecords")).map(o -> ((List) o)).orElse(null);
- List enterpriseSupplierInfoList = new ArrayList<>();
- if (CollUtil.isNotEmpty(enterpriseSupplierInfos)) {
- for (Object supplierInfo : enterpriseSupplierInfos) {
- Map map1 = (Map) supplierInfo;
- String projectManage = MapUtils.getString(map1, "field1889813380500");
- String longitude = FlowUtil.getLongitude(map1, "field5527613416017");
- String latitude = FlowUtil.getLongitude(map1, "field5527613416017");
- String projectNumber = MapUtils.getString(map1, "field3597413394967");
- String projectAcreage = MapUtils.getString(map1, "field8382113460000");
- String startWorkDate = MapUtils.getString(map1, "field3279513473516");
- String projectTel = MapUtils.getString(map1, "field3163913488700");
- String layoutImage = FlowUtil.getJSONString(map1, "field7572613509085");
- String constructionMapUrl = FlowUtil.getJSONString(map1, "field7824213496616");
- String cbsName = MapUtils.getString(map1, "field4214913364183");
- String projectBuildArea = MapUtils.getString(map1, "field8585413374585");
- Integer projectType = Optional.ofNullable(map1.get("field5423413438783")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Integer structureType = Optional.ofNullable(map1.get("field7147513453452")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Integer bulidStatus = Optional.ofNullable(map1.get("field9109313465100")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Integer constructionStage = Optional.ofNullable(map1.get("field7511013402167")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Integer cbsProjectType = Optional.ofNullable(map1.get("field6358113386450")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- Date completionDate = Optional.ofNullable(map1.get("field5019213481082")).map(o -> DateUtil.parse(o.toString())).orElse(null);
-
- ProjectEnterpriseSupplierInfo enterpriseSupplierInfo = new ProjectEnterpriseSupplierInfo();
- enterpriseSupplierInfo.setProjectSn(projectSn);
- enterpriseSupplierInfo.setProjectManage(projectManage);
- enterpriseSupplierInfo.setLongitude(longitude);
- enterpriseSupplierInfo.setLatitude(latitude);
- enterpriseSupplierInfo.setProjectNumber(projectNumber);
- enterpriseSupplierInfo.setProjectAcreage(projectAcreage);
- enterpriseSupplierInfo.setStartWorkDate(startWorkDate);
- enterpriseSupplierInfo.setProjectTel(projectTel);
- enterpriseSupplierInfo.setProjectType(projectType);
- enterpriseSupplierInfo.setStructureType(structureType);
- enterpriseSupplierInfo.setBulidStatus(bulidStatus);
- enterpriseSupplierInfo.setConstructionStage(constructionStage);
- enterpriseSupplierInfo.setLayoutImage(layoutImage);
- enterpriseSupplierInfo.setConstructionMapUrl(constructionMapUrl);
- enterpriseSupplierInfo.setCbsName(cbsName);
- enterpriseSupplierInfo.setProjectBuildArea(projectBuildArea);
- enterpriseSupplierInfo.setCompletionDate(completionDate);
- enterpriseSupplierInfo.setCbsProjectType(cbsProjectType);
- enterpriseSupplierInfo.setType(2);
-// enterpriseSupplierInfo.setXzSupplierQualificationApplyId(apply.getId());
- enterpriseSupplierInfoList.add(enterpriseSupplierInfo);
- }
- }
-
- List qualificationRecordList = new ArrayList<>();
- if (CollUtil.isNotEmpty(qualificationRecords)) {
- for (Object qr : qualificationRecords) {
- Map map1 = (Map) qr;
- String fileName = MapUtils.getString(map1, "field1715913568733");
- String fileNumber = MapUtils.getString(map1, "field1910713590018");
- String fileUrl = FlowUtil.getFileUrl(map1, "field1080013606067");
- String remarks = MapUtils.getString(map1, "field2502513615584");
- String originFileName = FlowUtil.getFileOriginFileName(map1, "field1080013606067");
- Integer qualificationType = Optional.ofNullable(map1.get("field4809313565733")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
-
- XzSupplierQualificationRecord qualificationRecord = new XzSupplierQualificationRecord();
-// qualificationRecord.setXzSupplierQualificationApplyId(apply.getId());
- qualificationRecord.setFileName(fileName);
- qualificationRecord.setFileNumber(fileNumber);
- qualificationRecord.setFileUrl(fileUrl);
- qualificationRecord.setRemarks(remarks);
- qualificationRecord.setOriginFileName(originFileName);
- qualificationRecord.setQualificationType(qualificationType);
- qualificationRecordList.add(qualificationRecord);
- }
- }
-
- EnterpriseInfo existEnterpriseInfo = enterpriseInfoService.getOne(new LambdaQueryWrapper().eq(EnterpriseInfo::getSocialCode, socialCode));
- if (existEnterpriseInfo != null) {
- List projectEnterpriseList = projectEnterpriseService.list(new LambdaQueryWrapper()
- .eq(ProjectEnterprise::getEnterpriseId, existEnterpriseInfo.getId())
- .eq(ProjectEnterprise::getProjectSn, projectSn));
- if (CollUtil.isNotEmpty(projectEnterpriseList)) {
- String msg = sub + "已存在";
- noticeService.addProjectLevelNotice(projectSn, title, msg, "1", null);
- emailUtils.sendSimpleMail(noticeEmail, sub + "入场审批不通过", msg);
- return Result.ok();
- }
- }
-
-// List mustHave = Arrays.asList(1, 2, 3);
-// Set set = qualificationRecordList.stream().filter(x -> mustHave.contains(x.getQualificationType())).map(XzSupplierQualificationRecord::getQualificationType).collect(Collectors.toSet());
-// int i = 3;
-// if (CollUtil.isEmpty(qualificationRecordList) || set.size() < i) {
-// throw new OpenAlertException("资质文件的资质类型的(安全协议、劳务分包合同、施工合同必须都要上传");
-// }
-
-// List supplierApprovalList = xzSupplierQualificationApplyService.getSupplierApprovalList(projectSn, socialCode);
-// long c1 = supplierApprovalList.stream().filter(apply1 -> Objects.equals(apply1.getApplyStatus(), 1)).count();
-// if (c1 > 0) {
-// String msg = "该承包商(信用代码:" + socialCode + ")待审核中";
-// noticeService.addProjectLevelNotice(projectSn, "承包商入场审核", msg, "1", null);
-// return Result.ok();
-// }
-// long c2 = supplierApprovalList.stream().filter(apply1 -> Objects.equals(apply1.getApplyStatus(), 2)).count();
-// if (c2 > 0) {
-// String msg = "该承包商(信用代码:" + socialCode + ")已审核通过";
-// noticeService.addProjectLevelNotice(projectSn, "承包商入场审核", msg, "1", null);
-// return Result.ok();
-// }
-
- XzSupplierRecord supplierRecord = new XzSupplierRecord();
- supplierRecord.setEnterpriseName(enterpriseName);
- supplierRecord.setDescription(description);
- supplierRecord.setEnterpriseAddress(enterpriseAddress);
- supplierRecord.setEnterpriseLegalPerson(enterpriseLegalPerson);
- supplierRecord.setLegalPersonIdCard(legalPersonIdCard);
- supplierRecord.setEnterpriseSafeAllow(enterpriseSafeAllow);
- supplierRecord.setEnterpriseProperty(enterpriseProperty);
- supplierRecord.setLegalPersonTel(legalPersonTel);
- supplierRecord.setSocialCode(socialCode);
- supplierRecord.setBusinessNumber(businessNumber);
- supplierRecord.setQualificationNumber(qualificationNumber);
- supplierRecord.setEnterpriseEmail(enterpriseEmail);
- supplierRecord.setRegisteredCapital(registeredCapital);
- supplierRecord.setBankname(bankname);
- supplierRecord.setBankcardnumber(bankcardnumber);
- supplierRecord.setBankcode(bankcode);
- supplierRecord.setEnterpriseQualificationUrl(enterpriseQualificationUrl);
- supplierRecord.setBusinessLicenseEndDate(businessLicenseEndDate);
- supplierRecord.setRegisterPersonName(registerPersonName);
- supplierRecord.setRegisterPersonPhoneTel(registerPersonPhoneTel);
- supplierRecord.setEnterpriseSn(enterpriseSn);
- supplierRecord.setLogo(logo);
- supplierRecord.setRegistDate(registDate);
- supplierRecord.setBusinessLicenseUrl(businessLicenseUrl);
-// supplierRecord.setXzSupplierQualificationApplyId(apply.getId());
- supplierRecord.setEnterpriseTypeId(enterpriseTypeId);
- supplierRecord.setProjectDirectorName(projectDirectorName);
- supplierRecord.setProjectDirectorPhone(projectDirectorPhone);
- supplierRecord.setAncestors(ancestors);
- supplierRecord.setType(1);
- supplierRecord.setParentEnterpriseId(parentEnterpriseId);
- supplierRecord.setSortNum(0);
- supplierRecord.setDepartmentType(2);
- xzSupplierRecordService.save(supplierRecord);
-
-// if (CollUtil.isNotEmpty(qualificationRecords)) {
-// xzSupplierQualificationRecordService.saveBatch(qualificationRecordList);
-// }
-
- String url = supplierResubmitApplicationUrl + "?token=" + getFlowStartUserToken().getResult() + "&sn=" + projectSn + "&instanceId=" + instanceId;
- if (Objects.equals(applyStatus, 2)) {
- //通过,添加到正式的数据中
- EnterpriseInfo enterpriseInfo = BeanUtil.copyProperties(supplierRecord, EnterpriseInfo.class);
- enterpriseInfo.setProjectSn(projectSn);
- try {
- enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo);
- } catch (OpenAlertException e) {
- log.error("工作流保存星纵承包商入场申请信息校验异常:", e);
- noticeService.addProjectLevelNotice(projectSn, title, sub + "审核不通过," + e.getMessage(), "1", null);
- emailUtils.sendSimpleMail(noticeEmail, sub + "入场审批不通过",
- StrUtil.format(e.getMessage() + ",重新提交申请链接(点击链接补充资质):{}", applyContent, url));
- return Result.ok();
- }
- if (CollUtil.isNotEmpty(qualificationRecordList)) {
- List copyToList = BeanUtil.copyToList(qualificationRecordList, EnterpriseQualification.class);
- for (EnterpriseQualification qualification : copyToList) {
- qualification.setId(null);
- qualification.setEnterpriseId(enterpriseInfo.getId());
- }
- enterpriseQualificationService.saveBatch(copyToList);
- }
- if (CollUtil.isNotEmpty(enterpriseSupplierInfos)) {
- enterpriseSupplierInfoList.stream().forEach(projectEnterpriseSupplierInfo -> projectEnterpriseSupplierInfo.setEnterpriseId(enterpriseInfo.getId()));
-// projectEnterpriseSupplierInfoService.saveBatch(enterpriseSupplierInfoList);
- List copyToList = BeanUtil.copyToList(enterpriseSupplierInfoList, ProjectEnterpriseSupplierInfo.class);
- for (ProjectEnterpriseSupplierInfo info : copyToList) {
- info.setId(null);
- info.setXzSupplierQualificationApplyId(null);
- info.setType(2);
- info.setEnterpriseId(enterpriseInfo.getId());
- }
- projectEnterpriseSupplierInfoService.saveBatch(copyToList);
- }
- noticeService.addProjectLevelNotice(projectSn, title, sub + "审核通过", "1", null);
- emailUtils.sendSimpleMail(noticeEmail, sub + "入场审批通过", sub + "入场审批通过");
- } else if (Objects.equals(applyStatus, 3)) {
- //驳回
- String msg = sub + "审核不通过";
- noticeService.addProjectLevelNotice(projectSn, title, msg, "1", null);
- emailUtils.sendSimpleMail(noticeEmail, sub + "入场审批不通过",
- StrUtil.format(msg + ",审批回复:{}\r\n重新提交申请链接(点击链接补充资质):{}", applyContent, url));
- }
- } catch (Exception e) {
- log.error("工作流保存星纵承包商入场申请信息异常:", e);
-// emailUtils.saveExceptionAndSendFlowEmail(paramStr, e, "工作流保存星纵承包商入场申请信息异常", "/xmgl/xzSupplierQualificationApply/flow/saveInfo", instanceId);
- }
- return Result.ok();
- }
-
@OperLog(operModul = "承包商-入场申请管理", operType = "审批通过", operDesc = "审批通过")
@ApiOperation(value = "审批通过", notes = "审批通过", httpMethod = "POST")
@PostMapping(value = "/pass")
@@ -476,19 +152,5 @@ public class XzSupplierQualificationApplyController {
return Result.ok();
}
- @OperLog(operModul = "承包商-入场申请管理", operType = "查询", operDesc = "工作流发起人的查询token")
- @ApiOperation(value = "工作流发起人的查询token", notes = "工作流发起人的查询token", httpMethod = "GET")
- @GetMapping(value = "/flow/start/token")
- public Result getFlowStartUserToken() {
- String account = "工作流发起人勿删";
- SystemUser systemUser = systemUserService.getOne(new LambdaUpdateWrapper().eq(SystemUser::getAccount, account));
- if (systemUser == null) {
- throw new OpenAlertException(MessageUtil.get("notFindErr"));
- }
- authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(systemUser.getAccount(), systemUser.getShowPassword()));
- String token = jwtTokenProvider.createToken(systemUser.getAccount(), 60 * 60 * 24);
- return Result.success(token);
- }
-
}
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/XzSecurityQualityRectifyRecord.java b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/XzSecurityQualityRectifyRecord.java
index 0b499988b..47c05d57a 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/XzSecurityQualityRectifyRecord.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/XzSecurityQualityRectifyRecord.java
@@ -83,7 +83,7 @@ public class XzSecurityQualityRectifyRecord implements Serializable {
*/
@Excel(name = "违章人员", width = 15)
@ApiModelProperty(value = "违章人员")
- private String violatorId;
+ private Long violatorId;
@TableField(exist = false)
private String realName;
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScore.java b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScore.java
new file mode 100644
index 000000000..8cf30d874
--- /dev/null
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScore.java
@@ -0,0 +1,15 @@
+package com.zhgd.xmgl.modules.xz.security.entity.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public
+class FiveScore {
+ private BigDecimal aqgl;
+ private BigDecimal wmsg;
+ private BigDecimal sgzj;
+ private BigDecimal gcqx;
+ private BigDecimal wxzy;
+}
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScoresVo.java b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScoresVo.java
index 69e4ce6db..b496fea40 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScoresVo.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/FiveScoresVo.java
@@ -10,5 +10,5 @@ class FiveScoresVo {
private BigDecimal monthScore;
private BigDecimal lastMonthScore;
private BigDecimal differScoreRate;
- private TenScore thisMonthScores;
+ private FiveScore thisMonthScores;
}
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/TenScore.java b/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/TenScore.java
deleted file mode 100644
index b5713bd78..000000000
--- a/src/main/java/com/zhgd/xmgl/modules/xz/security/entity/vo/TenScore.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.zhgd.xmgl.modules.xz.security.entity.vo;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-@Data
-public
-class TenScore {
- @ApiModelProperty("安全管理")
- private BigDecimal aqgl;
- @ApiModelProperty("文明施工")
- private BigDecimal wmsg;
- @ApiModelProperty("脚手架")
- private BigDecimal jsj;
- @ApiModelProperty("基坑工程")
- private BigDecimal jkgc;
- @ApiModelProperty("模板支架")
- private BigDecimal mbzj;
- @ApiModelProperty("物料提升机")
- private BigDecimal wltsj;
- @ApiModelProperty("塔式起重机")
- private BigDecimal tsqzj;
- @ApiModelProperty("高处作业")
- private BigDecimal gczy;
- @ApiModelProperty("施工用电")
- private BigDecimal sgyd;
- @ApiModelProperty("施工机具")
- private BigDecimal sgjj;
-}
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/security/service/impl/XzSecurityQualityRectifyRecordServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/xz/security/service/impl/XzSecurityQualityRectifyRecordServiceImpl.java
index 49b668b55..3c68bbc45 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/security/service/impl/XzSecurityQualityRectifyRecordServiceImpl.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/security/service/impl/XzSecurityQualityRectifyRecordServiceImpl.java
@@ -17,6 +17,7 @@ import com.gexin.fastjson.JSONObject;
import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.xmgl.call.SanjiangDataCall;
import com.zhgd.xmgl.constant.Cts;
+import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
@@ -208,35 +209,33 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl map = new HashMap<>(16);
- map.put("id", workerInfo.getId());
- map.put("deductScore", ds);
- workerInfoService.updateScoreSendAuth(map);
-
- //存记录
- XzDeductScoreRecord vo = new XzDeductScoreRecord();
- vo.setProjectSn(hiddenDangerInspectRecord.getProjectSn());
- vo.setWorkerId(workerInfo.getId());
- vo.setTypeName(item.getContent());
- vo.setDeductScore(-item.getDeductScore());
- vo.setType(1);
- vo.setCreateDate(new Date());
- vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
- vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "无" : vo.getTypeName(), item.getDeductScore()));
- vo.setTypeTableId(hiddenDangerInspectRecord.getId());
- xzDeductScoreRecordMapper.insert(vo);
+ WorkerInfo workerInfo = workerInfoMapper.selectById(changeUser);
+ if (workerInfo == null) {
+ return;
}
+
+ //扣分
+ HashMap map = new HashMap<>(16);
+ map.put("id", workerInfo.getId());
+ map.put("deductScore", ds);
+ workerInfoService.updateScoreSendAuth(map);
+
+ //存记录
+ XzDeductScoreRecord vo = new XzDeductScoreRecord();
+ vo.setProjectSn(hiddenDangerInspectRecord.getProjectSn());
+ vo.setWorkerId(workerInfo.getId());
+ vo.setTypeName(item.getContent());
+ vo.setDeductScore(-item.getDeductScore());
+ vo.setType(1);
+ vo.setCreateDate(new Date());
+ vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
+ vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "无" : vo.getTypeName(), item.getDeductScore()));
+ vo.setTypeTableId(hiddenDangerInspectRecord.getId());
+ xzDeductScoreRecordMapper.insert(vo);
}
@Override
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/service/IXzSupplierQualificationApplyService.java b/src/main/java/com/zhgd/xmgl/modules/xz/service/IXzSupplierQualificationApplyService.java
index 41bf8b915..167431b1b 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/service/IXzSupplierQualificationApplyService.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/service/IXzSupplierQualificationApplyService.java
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.xz.entity.XzSupplierQualificationApply;
import com.zhgd.xmgl.modules.xz.entity.vo.XzSupplierQualificationApplyDto;
-import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
@@ -73,14 +72,4 @@ public interface IXzSupplierQualificationApplyService extends IService getSupplierApprovalList(String projectSn, String socialCode);
-
}
diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzSupplierQualificationApplyServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzSupplierQualificationApplyServiceImpl.java
index 737b6b9d5..a10d3ef94 100644
--- a/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzSupplierQualificationApplyServiceImpl.java
+++ b/src/main/java/com/zhgd/xmgl/modules/xz/service/impl/XzSupplierQualificationApplyServiceImpl.java
@@ -287,9 +287,4 @@ public class XzSupplierQualificationApplyServiceImpl extends ServiceImpl getSupplierApprovalList(String projectSn, String socialCode) {
- return baseMapper.getSupplierApprovalList(projectSn, socialCode);
- }
-
}
diff --git a/src/main/java/com/zhgd/xmgl/util/FlowUtil.java b/src/main/java/com/zhgd/xmgl/util/FlowUtil.java
deleted file mode 100644
index e73bb9b7d..000000000
--- a/src/main/java/com/zhgd/xmgl/util/FlowUtil.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.zhgd.xmgl.util;
-
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSON;
-import org.apache.commons.collections.MapUtils;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-public class FlowUtil {
-
-
- /**
- * 获取文件url
- *
- * @param map
- * @param key
- * @return
- */
- public static String getFileUrl(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> ((Map) ((List) o).get(0)).get("url").toString()).orElse(null);
- }
-
- /**
- * 获取文件url完整链接
- *
- * @param map
- * @param key
- * @return
- */
- public static String getFileUrlWithHost(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> PathUtil.getServerUrl() + "/image/" + ((Map) ((List) o).get(0)).get("url").toString()).orElse(null);
- }
-
- /**
- * 获取文件原来的名称
- *
- * @param map
- * @param key
- * @return
- */
- public static String getFileOriginFileName(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> ((Map) ((List) o).get(0)).get("name").toString()).orElse(null);
- }
-
- /**
- * 获取下拉Long
- *
- * @param map
- * @param key
- * @return
- */
- public static Long getPullDownLong(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> Convert.toLong(((List) o).get(0))).orElse(null);
- }
-
- public static Date getDate(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> DateUtil.parse(o.toString())).orElse(null);
- }
-
- public static String getJSONString(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(JSON::toJSONString).orElse(null);
- }
-
- public static List getList(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> ((List) o)).orElse(null);
- }
-
- public static String getString(Map map, String key) {
- return MapUtils.getString(map, key);
- }
-
- public static Integer getPullDownInteger(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
- }
-
- public static String getLongitude(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> JSON.parseObject(o.toString()).getString("lng")).orElse(null);
- }
-
- public static String getLatitude(Map map, String key) {
- return Optional.ofNullable(map.get(key)).map(o -> JSON.parseObject(o.toString()).getString("lat")).orElse(null);
- }
-
-}
diff --git a/src/main/java/com/zhgd/xmgl/util/PathUtil.java b/src/main/java/com/zhgd/xmgl/util/PathUtil.java
index 7209289c8..cd774d541 100644
--- a/src/main/java/com/zhgd/xmgl/util/PathUtil.java
+++ b/src/main/java/com/zhgd/xmgl/util/PathUtil.java
@@ -8,7 +8,6 @@ import org.springframework.stereotype.Component;
public class PathUtil {
private static String basePath;
- private static String serverUrl;
/**
* 删除多余的斜杠
@@ -19,25 +18,6 @@ public class PathUtil {
return path.replaceAll("([^:])(//+)", "$1/");
}
- public static String getBasePath() {
- return StrUtil.removeSuffix(basePath, "/");
- }
-
- @Value("${basePath}")
- public void setBasePath(String basePath) {
- PathUtil.basePath = basePath;
- }
-
- public static String getServerUrl() {
- return StrUtil.removeSuffix(serverUrl, "/");
- }
-
- @Value("${serverUrl}")
- public void setServerUrl(String serverUrl) {
- PathUtil.serverUrl = serverUrl;
- }
-
-
public static void main(String[] args) {
System.out.println(reviseSlash("/home//foo/"));
System.out.println(reviseSlash("/home/foo/"));
@@ -47,4 +27,12 @@ public class PathUtil {
System.out.println(reviseSlash("http://192.168.34.221:9111/image//65e5733735f013f4cc322278.jpg"));
}
+ public static String getBasePath() {
+ return StrUtil.removeSuffix(basePath, "/");
+ }
+
+ @Value("${basePath}")
+ public void setBasePath(String basePath) {
+ PathUtil.basePath = basePath;
+ }
}