mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-14 20:30:04 +08:00
update
This commit is contained in:
@@ -212,20 +212,10 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. 新增sys_dept
|
// 创建站点对应部门
|
||||||
SysDept dept = new SysDept();
|
SysDept dept = sysDeptService.createStationDept(Long.valueOf(merchantInfo.getDeptId()), dto.getStationName(), dto.getStationAdminName(), dto.getStationTel());
|
||||||
// 根据运营商Id查询到对应的部门id
|
|
||||||
dept.setParentId(Long.parseLong(merchantInfo.getDeptId()));
|
|
||||||
dept.setOrderNum(0);
|
|
||||||
|
|
||||||
dept.setDeptName(StringUtils.trim(dto.getStationName()));
|
|
||||||
dept.setLeader(StringUtils.trim(dto.getStationAdminName()));
|
|
||||||
dept.setPhone(StringUtils.trim(dto.getStationTel()));
|
|
||||||
dept.setStatus("0");
|
|
||||||
sysDeptService.insertDept(dept);
|
|
||||||
|
|
||||||
PileStationInfo pileStationInfo = new PileStationInfo();
|
PileStationInfo pileStationInfo = new PileStationInfo();
|
||||||
// pileStationInfo.setId(dept.getDeptId());
|
|
||||||
pileStationInfo.setDeptId(String.valueOf(dept.getDeptId()));
|
pileStationInfo.setDeptId(String.valueOf(dept.getDeptId()));
|
||||||
// 前端输入信息
|
// 前端输入信息
|
||||||
pileStationInfo.setMerchantId(Long.valueOf(dto.getMerchantId()));
|
pileStationInfo.setMerchantId(Long.valueOf(dto.getMerchantId()));
|
||||||
@@ -259,9 +249,14 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + pileStationInfo.getId();
|
String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + pileStationInfo.getId();
|
||||||
redisCache.deleteObject(redisKey);
|
redisCache.deleteObject(redisKey);
|
||||||
|
|
||||||
|
// 更新数据库
|
||||||
pileStationInfo.setUpdateBy(SecurityUtils.getUsername());
|
pileStationInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
pileStationInfo.setUpdateTime(DateUtils.getNowDate());
|
pileStationInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo);
|
int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo);
|
||||||
|
|
||||||
|
// 同步组织中的名称,联系人,电话
|
||||||
|
SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId()));
|
||||||
|
|
||||||
// 若修改运营商,则将此站点下所有桩对应的运营商也进行修改
|
// 若修改运营商,则将此站点下所有桩对应的运营商也进行修改
|
||||||
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getMerchantId()))) {
|
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getMerchantId()))) {
|
||||||
// 先查出桩基本信息
|
// 先查出桩基本信息
|
||||||
@@ -271,9 +266,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
// 修改桩基本信息
|
// 修改桩基本信息
|
||||||
pileBasicInfoService.updatePileMerchantBatch(pileIdList, String.valueOf(pileStationInfo.getMerchantId()));
|
pileBasicInfoService.updatePileMerchantBatch(pileIdList, String.valueOf(pileStationInfo.getMerchantId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改了运营商,同步修改组织
|
||||||
|
|
||||||
}
|
}
|
||||||
// 同步组织中的名称,联系人,电话
|
|
||||||
SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId()));
|
|
||||||
if (sysDept != null) {
|
if (sysDept != null) {
|
||||||
sysDept.setDeptName(pileStationInfo.getStationName());
|
sysDept.setDeptName(pileStationInfo.getStationName());
|
||||||
sysDept.setLeader(pileStationInfo.getStationAdminName());
|
sysDept.setLeader(pileStationInfo.getStationAdminName());
|
||||||
|
|||||||
@@ -113,4 +113,12 @@ public interface SysDeptService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建站点对应的组织部门
|
||||||
|
* @param parentDeptId 运营商对应的deptId
|
||||||
|
* @param stationAdminName 站点负责人姓名,用作组织部门负责人姓名
|
||||||
|
* @param stationTel 站点联系电话, 用作联系电话
|
||||||
|
*/
|
||||||
|
SysDept createStationDept(Long parentDeptId, String stationName, String stationAdminName, String stationTel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.system.service.impl;
|
package com.jsowell.system.service.impl;
|
||||||
|
|
||||||
import com.jsowell.common.annotation.DataScope;
|
import com.jsowell.common.annotation.DataScope;
|
||||||
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.constant.UserConstants;
|
import com.jsowell.common.constant.UserConstants;
|
||||||
import com.jsowell.common.core.domain.TreeSelect;
|
import com.jsowell.common.core.domain.TreeSelect;
|
||||||
import com.jsowell.common.core.domain.entity.SysDept;
|
import com.jsowell.common.core.domain.entity.SysDept;
|
||||||
@@ -292,4 +293,25 @@ public class SysDeptServiceImpl implements SysDeptService {
|
|||||||
private boolean hasChild(List<SysDept> list, SysDept t) {
|
private boolean hasChild(List<SysDept> list, SysDept t) {
|
||||||
return getChildList(list, t).size() > 0;
|
return getChildList(list, t).size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建站点对应的组织部门
|
||||||
|
* @param parentDeptId 运营商对应的deptId
|
||||||
|
* @param stationAdminName 站点负责人姓名,用作组织部门负责人姓名
|
||||||
|
* @param stationTel 站点联系电话, 用作联系电话
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysDept createStationDept(Long parentDeptId, String stationName, String stationAdminName, String stationTel) {
|
||||||
|
// 新增sys_dept
|
||||||
|
SysDept dept = new SysDept();
|
||||||
|
// 根据运营商Id查询到对应的部门id
|
||||||
|
dept.setParentId(parentDeptId);
|
||||||
|
dept.setOrderNum(Constants.zero);
|
||||||
|
dept.setDeptName(StringUtils.trim(stationName));
|
||||||
|
dept.setLeader(StringUtils.trim(stationAdminName));
|
||||||
|
dept.setPhone(StringUtils.trim(stationTel));
|
||||||
|
dept.setStatus(Constants.ZERO);
|
||||||
|
insertDept(dept);
|
||||||
|
return dept;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user