Browse Source

Merge branch 'release_temp' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

master
sunyuchao 4 years ago
parent
commit
2fe214dcac
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 12
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java
  3. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java
  4. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  5. 21
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StaffPatrolService.java
  6. 33
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java
  7. 40
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java
  8. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java
  9. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java
  10. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  11. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  12. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java
  13. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java
  14. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java
  15. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -190,7 +190,8 @@ public enum EpmetErrorCode {
NOTICE_BE_OVERDUE(8915,"通知已过期不允许再次变更"),
SAME_RULE_NAME(8916,"该积分事件已存在,请重新调整保存"),
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存");
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"),
BADGE_CHECK(8918,"");
private int code;

12
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java

@ -25,12 +25,22 @@ public class ExceptionUtils {
* @return 返回异常信息
*/
public static String getErrorStackTrace(Exception ex){
return getErrorStackTraceOfThrowable(ex);
}
/**
* @Description Throwable级别的错误信息
* @return
* @author wxz
* @date 2021.07.07 14:37
*/
public static String getErrorStackTraceOfThrowable(Throwable t) {
StringWriter sw = null;
PrintWriter pw = null;
try {
sw = new StringWriter();
pw = new PrintWriter(sw, true);
ex.printStackTrace(pw);
t.printStackTrace(pw);
}finally {
try {
if(pw != null) {

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java

@ -66,7 +66,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
//日期格式转换
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN));
mapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
//Long类型转String类型

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

@ -286,13 +286,13 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
entity.setJoinTotal(0);
entity.setJoinTotalUpRate(new BigDecimal("0"));
entity.setJoinTotalUpFlag("");
entity.setJoinTotalUpFlag(GovernConstant.EQ);
entity.setAvgIssue(new BigDecimal(0));
entity.setAvgIssueUpRate(new BigDecimal("0"));
entity.setAvgIssueUpFlag("");
entity.setAvgIssueUpFlag(GovernConstant.EQ);
entity.setAvgJoin(new BigDecimal(0));
entity.setAgvgJoinUpRate(new BigDecimal("0"));
entity.setAgvgJoinUpFlag("");
entity.setAgvgJoinUpFlag(GovernConstant.EQ);
entity.setAvgIssueFz(NumConstant.ZERO);
entity.setAvgIssueFm(NumConstant.ZERO);
entity.setAvgJoinFz(NumConstant.ZERO);

21
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StaffPatrolService.java

@ -0,0 +1,21 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StartPatrolFormDTO;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:39
*/
public interface StaffPatrolService {
/**
* 结束巡查
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:40
*/
Result endPatrol(StartPatrolFormDTO formDTO);
}

33
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java

@ -0,0 +1,33 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StartPatrolFormDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.StaffPatrolService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:40
*/
@Service
public class StaffPatrolServiceImpl implements StaffPatrolService {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 结束巡查
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:40
*/
@Override
public Result endPatrol(StartPatrolFormDTO formDTO) {
return epmetUserOpenFeignClient.endPatrolJob(formDTO);
}
}

40
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java

@ -0,0 +1,40 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.form.StartPatrolFormDTO;
import com.epmet.service.StaffPatrolService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:36
*/
@Component("endPatrolTask")
@Slf4j
public class EndPatrolTask implements ITask {
@Resource
private StaffPatrolService staffPatrolService;
@Override
public void run(String params) {
log.info("EndPatrolTask定时任务正在执行,参数为:{}", params);
ExtractOriginFormDTO dto = new ExtractOriginFormDTO();
StartPatrolFormDTO formDTO = new StartPatrolFormDTO();
if (StringUtils.isNotBlank(params)) {
dto = JSON.parseObject(params, ExtractOriginFormDTO.class);
formDTO.setCustomerId(dto.getCustomerId());
}
Result result = staffPatrolService.endPatrol(formDTO);
if (result.success()) {
log.info("EndPatrolTask定时任务执行成功");
} else {
log.error("EndPatrolTask定时任务执行失败:" + result.getMsg());
}
}
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java

@ -39,4 +39,6 @@ public class StartPatrolFormDTO implements Serializable {
private String staffPatrolRecId;
private String patrolEndTime;
private String customerId;
}

13
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java

@ -62,4 +62,17 @@ public class CertificationDetailResultDTO implements Serializable {
* 审核记录ID
*/
private String recordId;
public CertificationDetailResultDTO() {
this.surname = "";
this.name = "";
this.idcard = "";
this.isCertificated = "";
this.mobile = "";
this.certificationImg = "";
this.remark = "";
this.authResult = "";
this.authReason = "";
this.recordId = "";
}
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -595,4 +595,14 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/staffrole/getroles")
Result<CustomerAgencyUserRoleDTO> getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO);
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 17:32
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/epmetuser/staffpatrol/endpatrolJob")
Result endPatrolJob(@RequestBody StartPatrolFormDTO formDTO);
}

13
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -409,4 +409,17 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoles", formDTO);
}
/**
* 结束巡查 定时任务
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:32
*/
@Override
public Result endPatrolJob(StartPatrolFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "endPatrolJob", formDTO);
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java

@ -87,6 +87,20 @@ public class StaffPatrolController {
}
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 17:00
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("endpatrolJob")
public Result endPatrolJob(@RequestBody StartPatrolFormDTO formDTO) {
staffPatrolRecordService.endPatrolJob(formDTO);
return new Result();
}
/**
* 上传巡查记录
*

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java

@ -72,6 +72,14 @@ public interface StaffPatrolRecordService extends BaseService<StaffPatrolRecordE
*/
void endPatrol(TokenDto tokenDto, StartPatrolFormDTO formDTO);
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 16:59
* @param formDTO
* @return void
*/
void endPatrolJob(StartPatrolFormDTO formDTO);
/**
* 上传巡查记录
*

31
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -276,6 +276,37 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
statsPatrolUpdateEnd(tokenDto.getUserId(),totalTime,record.getPatrolStartTime(),patrolEndTime,record.getGrid());
}
/**
* 结束巡查 定时任务
*
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2021/7/12 16:59
*/
@Override
public void endPatrolJob(StartPatrolFormDTO formDTO) {
LambdaQueryWrapper<StaffPatrolRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StaffPatrolRecordEntity :: getStatus, PatrolConstant.PATROLLING);
wrapper.eq(StringUtils.isNotBlank(formDTO.getCustomerId()), StaffPatrolRecordEntity :: getCustomerId, formDTO.getCustomerId());
List<StaffPatrolRecordEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
String endTimeStr = DateUtils.format(item.getPatrolStartTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
endTimeStr = endTimeStr.concat("235959");
Date endTime = DateUtils.parse(endTimeStr, DateUtils.DATE_TIME_NO_SPLIT);
item.setPatrolEndTime(endTime);
item.setActrualEndTime(endTime);
item.setStatus(PatrolConstant.END);
Integer totalTime = DateUtils.calculateSecond(item.getPatrolStartTime(), endTime) + 59;
item.setTotalTime(totalTime);
item.setUpdatedTime(null);
});
updateBatchById(list);
}
}
/**
* @Description 巡查结束时添加巡查统计表逻辑
* @Param userId

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -247,6 +247,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
@Override
@Transactional(rollbackFor = Exception.class)
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) {
// 校验这个徽章此人有没有
Integer recordCount = userBadgeCertificateRecordDao.selectIsExist(certificationAddFormDTO.getBadgeId(), certificationAddFormDTO.getUserId());
if (recordCount>NumConstant.ZERO){
throw new RenException("不允许重复提交审核");
@ -296,7 +297,9 @@ public class UserBadgeServiceImpl implements UserBadgeService {
.map(AuthFieldResultDTO::getEnName).collect(Collectors.toSet());
List<String> missColumns = ValidatorUtils.hasAllRequired(JSON.toJSONString(certificationAddFormDTO), requiredColumns);
if (!CollectionUtils.isEmpty(missColumns)) {
throw new RenException(JSON.toJSONString(missColumns).concat("不能为空"));
EpmetErrorCode.BADGE_CHECK.setMsg(JSON.toJSONString(missColumns).concat("不能为空"));
throw new RenException(EpmetErrorCode.BADGE_CHECK.getCode());
// throw new RenException(JSON.toJSONString(missColumns).concat("不能为空"));
}
}
@ -360,6 +363,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
*/
@Override
public List<AuthFieldResultDTO> authField(AuthFieldFormDTO authFieldFormDTO) {
// 查询徽章要显示的认证信息字段
List<AuthFieldResultDTO> authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)){
authFieldFormDTO.setCustomerId(BadgeConstant.DEFAULT_CUSTOMER);

Loading…
Cancel
Save