Browse Source

Merge remote-tracking branch 'origin/dev_plugins' into dev_temp

master
wangchao 5 years ago
parent
commit
e59afb68ab
  1. 4
      epmet-module/epmet-third/epmet-third-server/pom.xml
  2. 8
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java
  3. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java
  4. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java
  5. 31
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml

4
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -203,8 +203,8 @@
<spring.redis.password>123456</spring.redis.password> <spring.redis.password>123456</spring.redis.password>
<!-- nacos --> <!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled> <nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.1.130:8848</nacos.server-addr> <nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>6ceab336-d004-4acf-89c6-e121d06f4988</nacos.discovery.namespace> <nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace> <nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group> <nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled> <nacos.config-enabled>false</nacos.config-enabled>

8
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java

@ -220,6 +220,14 @@ public class StaffAgencyServiceImpl implements StaffAgencyService {
Result<CustomerGridByUserIdResultDTO> staffGridResult = Result<CustomerGridByUserIdResultDTO> staffGridResult =
govOrgFeignClient.getStaffGrid(latestGridFormDTO); govOrgFeignClient.getStaffGrid(latestGridFormDTO);
if (staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())) { if (staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())) {
StaffGridVisitedFormDTO gridRecordParam = new StaffGridVisitedFormDTO();
gridRecordParam.setGridId(staffGridResult.getData().getGridId());
gridRecordParam.setCustomerId(latestGridFormDTO.getCustomerId());
gridRecordParam.setStaffId(latestGridFormDTO.getStaffId());
Result writeRecordResult = epmetUserFeignClient.saveStaffGridVisitedRecord(gridRecordParam);
if(writeRecordResult.success()){
logger.warn("com.epmet.service.impl.StaffAgencyServiceImpl.getLatestGrid,工作人员网格访问网格写入失败,staffId:{},gridId:{}",latestGridFormDTO.getStaffId(),staffGridResult.getData().getGridId());
}
return staffGridResult; return staffGridResult;
} }
} }

21
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java

@ -23,6 +23,8 @@ import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.entity.StaffGridVisitedEntity; import com.epmet.entity.StaffGridVisitedEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.Date;
/** /**
* 工作人员进入网格日志表 * 工作人员进入网格日志表
* *
@ -41,4 +43,23 @@ public interface StaffGridVisitedDao extends BaseDao<StaffGridVisitedEntity> {
**/ **/
String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO);
/**
* @Description 根据staffId和customerId查询当前用户上一次登陆的网格Id,Id,创建时间
* @param latestGridFormDTO
* @return StaffGridVisitedEntity
* @author wangc
* @date 2020.08.27 15:05
**/
StaffGridVisitedEntity selectVisitedRecordByStaffId(LatestGridFormDTO latestGridFormDTO);
/**
* @Description 更新工作人员网格登陆记录的时间
* @param id
* @param date
* @return
* @author wangc
* @date 2020.08.27 16:28
**/
void updateRecordTime(String id, Date date);
} }

24
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java

@ -43,9 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* 工作人员进入网格日志表 * 工作人员进入网格日志表
@ -124,10 +122,28 @@ public class StaffGridVisitedServiceImpl extends BaseServiceImpl<StaffGridVisite
@Override @Override
public Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { public Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) {
Calendar currentCal = Calendar.getInstance();
currentCal.setTime(new Date());
CustomerGridByUserIdResultDTO gridResult = new CustomerGridByUserIdResultDTO(); CustomerGridByUserIdResultDTO gridResult = new CustomerGridByUserIdResultDTO();
String gridId = baseDao.selectStaffLatestGrid(latestGridFormDTO); StaffGridVisitedEntity recordEntity = baseDao.selectVisitedRecordByStaffId(latestGridFormDTO);
String gridId = null == recordEntity ? null : recordEntity.getGridId();
if(StringUtils.isNotBlank(gridId)){ if(StringUtils.isNotBlank(gridId)){
Calendar recordCal = Calendar.getInstance();
recordCal.setTime(recordEntity.getCreatedTime());
if(currentCal.get(Calendar.YEAR) == recordCal.get(Calendar.YEAR) &&
currentCal.get(Calendar.DAY_OF_YEAR) == recordCal.get(Calendar.DAY_OF_YEAR)
&& StringUtils.isNotBlank(recordEntity.getId())){
//同一天 更新
baseDao.updateRecordTime(recordEntity.getId(),currentCal.getTime());
}else{
//非同一天 新增
recordEntity.setCustomerId(latestGridFormDTO.getCustomerId());
recordEntity.setStaffId(latestGridFormDTO.getStaffId());
recordEntity.setId(null);
recordEntity.setCreatedTime(null);
baseDao.insert(recordEntity);
}
CustomerGridFormDTO param = new CustomerGridFormDTO(); CustomerGridFormDTO param = new CustomerGridFormDTO();
param.setGridId(gridId); param.setGridId(gridId);
Result<CustomerGridDTO> gridInfoResult = Result<CustomerGridDTO> gridInfoResult =

31
epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml

@ -33,4 +33,35 @@
LIMIT 1 LIMIT 1
</select> </select>
<!-- 根据staffId和customerId查询当前用户上一次登陆的网格Id,Id,创建时间 -->
<select id="selectVisitedRecordByStaffId" resultType="com.epmet.entity.StaffGridVisitedEntity">
SELECT
ID,
GRID_ID,
CREATED_TIME
FROM
STAFF_GRID_VISITED
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND STAFF_ID = #{staffId}
ORDER BY
CREATED_TIME DESC
LIMIT 1
</select>
<!-- 更新工作人员网格登陆记录的时间 -->
<update id="updateRecordTime">
UPDATE
STAFF_GRID_VISITED
SET
CREATED_TIME = #{date},
UPDATED_TIME = #{date}
WHERE
DEL_FLAG = '0'
AND
ID = #{id}
</update>
</mapper> </mapper>
Loading…
Cancel
Save