Browse Source

Merge remote-tracking branch 'origin/dev_grid_patrol' into dev_grid_patrol

dev_shibei_match
sunyuchao 4 years ago
parent
commit
ccf4cab5bf
  1. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  2. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
  3. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  4. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  5. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -83,7 +83,10 @@ public class ScreenProjectDataDTO implements Serializable {
* 事件时间
*/
private Date projectCreateTime;
/**
* 上报人ID
*/
private String linkUserId;
/**
* 上报人
*/

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java

@ -79,6 +79,11 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity {
*/
private String projectCreateTime;
/**
* 上报人ID
*/
private String linkUserId;
/**
* 上报人
*/

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

@ -87,6 +87,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
//直接立项的话 项目内容是项目背景 经纬度添加
if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){
meta.setProjectContent(projectInfo.getBackGround());
meta.setLinkUserId(projectInfo.getCreatedBy());
meta.setLinkName(projectInfo.getCreatedBy());
if (StringUtils.isNotBlank(projectInfo.getLocateDimension())){
meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension()));

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -272,7 +272,10 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId);
}
List<List<ScreenProjectDataDTO>> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED);
partition.forEach(part -> baseDao.insertBatch(part));
partition.forEach(part -> {
List<ScreenProjectDataEntity> list = ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class);
insertBatch(list);
});
}

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

@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
@ -34,6 +35,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -187,9 +189,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
throw new RenException("巡查记录不存在");
}
if (PatrolConstant.END.equals(record.getStatus())) {
throw new RenException("巡查已结束,请勿重复提交");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "巡查已结束,请勿重复提交");
}
if (record.getPatrolStartTime().compareTo(Objects.requireNonNull(DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN))) > 0) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "巡查结束时间不能小于巡查开始时间");
}
record.setActrualEndTime(new Date());
record.setUpdatedTime(null);
record.setPatrolEndTime(DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN));

Loading…
Cancel
Save