(cherry picked from commit 0bb109f523)
This commit is contained in:
2023-05-10 08:50:19 +08:00
parent 4f0f785839
commit f482f71007

View File

@@ -252,16 +252,29 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
* @return 结果
*/
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public int updatePileStationInfo(PileStationInfo pileStationInfo) {
// 清缓存
String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + pileStationInfo.getId();
redisCache.deleteObject(redisKey);
pileStationInfo.setUpdateBy(SecurityUtils.getUsername());
pileStationInfo.setUpdateTime(DateUtils.getNowDate());
// 同步组织中的名称,联系人,电话
// sysDeptService.updateDept()
int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo);
return pileStationInfoMapper.updatePileStationInfo(pileStationInfo);
// 同步组织中的名称,联系人,电话
SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId()));
if (sysDept != null) {
sysDept.setDeptName(pileStationInfo.getStationName());
sysDept.setLeader(pileStationInfo.getStationAdminName());
sysDept.setPhone(pileStationInfo.getStationTel());
sysDept.setUpdateTime(DateUtils.getNowDate());
sysDeptService.updateDept(sysDept);
}
// 再次清缓存
redisCache.deleteObject(redisKey);
return i;
}
/**