update 修改运营商名称时,将对应的部门表中名称进行对应修改

This commit is contained in:
Lemon
2023-09-25 15:59:37 +08:00
parent 2a6abe7341
commit c7691993c7

View File

@@ -209,6 +209,17 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
@Override
public int updatePileMerchantInfo(PileMerchantInfo pileMerchantInfo) {
pileMerchantInfo.setUpdateTime(DateUtils.getNowDate());
// 如果修改运营商名称,需将 sys_menu 表中的 dept_name 字段对应修改
String deptId = pileMerchantInfo.getDeptId();
SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(deptId));
if (sysDept == null) {
return 0;
}
if (!StringUtils.equals(pileMerchantInfo.getMerchantName(), sysDept.getDeptName())) {
// 不一致,进行修改
sysDept.setDeptName(pileMerchantInfo.getMerchantName());
sysDeptService.updateDept(sysDept);
}
return pileMerchantInfoMapper.updatePileMerchantInfo(pileMerchantInfo);
}