mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 18:19:36 +08:00
修改了对应bug
This commit is contained in:
parent
d0da4caa5e
commit
ecb05e470c
@ -145,12 +145,14 @@ public class RepairDeviceTypeController extends BaseController {
|
|||||||
customerStaffService.updateIcsCustomerStaff(staff1);
|
customerStaffService.updateIcsCustomerStaff(staff1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int i1 = repairRelationalService.deleteByTypeId(repairDeviceType.getId());
|
int i1 = repairRelationalService.deleteByTypeId(repairDeviceType.getId());
|
||||||
if (i1>=0){
|
if (i1>=0){
|
||||||
|
int count = repairRelationalService.selectCountByUserId(repairDeviceType.getStaffId());
|
||||||
|
|
||||||
|
if (count >0){
|
||||||
|
IcsCustomerStaff staff = customerStaffService.selectIcsCustomerStaffById(repairDeviceType.getStaffId());
|
||||||
|
return R.error("该"+staff.getUsername()+"已有角色,请先删除对应角色在添加");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//保存成功后,添加设备与派单员关联关系
|
//保存成功后,添加设备与派单员关联关系
|
||||||
@ -167,6 +169,13 @@ public class RepairDeviceTypeController extends BaseController {
|
|||||||
|
|
||||||
//保存成功后,添加设备与维修人关联关系
|
//保存成功后,添加设备与维修人关联关系
|
||||||
for (Long aLong : repairDeviceType.getWorkerId()) {
|
for (Long aLong : repairDeviceType.getWorkerId()) {
|
||||||
|
int count1 = repairRelationalService.selectCountByUserId(aLong);
|
||||||
|
|
||||||
|
if (count1 >0){
|
||||||
|
IcsCustomerStaff staff1 = customerStaffService.selectIcsCustomerStaffById(aLong);
|
||||||
|
|
||||||
|
return R.error("该"+staff1.getUsername()+"已有角色,请先删除对应角色在添加");
|
||||||
|
}
|
||||||
RepairRelational repairRelational1 = new RepairRelational();
|
RepairRelational repairRelational1 = new RepairRelational();
|
||||||
repairRelational1.setTypeId(repairDeviceType.getId());
|
repairRelational1.setTypeId(repairDeviceType.getId());
|
||||||
repairRelational1.setUserId(aLong);
|
repairRelational1.setUserId(aLong);
|
||||||
|
@ -66,4 +66,6 @@ public interface IRepairRelationalService extends IService<RepairRelational> {
|
|||||||
List<RepairRelational> selectWorkerIdByTypeId(Long typeId);
|
List<RepairRelational> selectWorkerIdByTypeId(Long typeId);
|
||||||
|
|
||||||
Long selectByUserId(Long id);
|
Long selectByUserId(Long id);
|
||||||
|
|
||||||
|
int selectCountByUserId(Long staffId);
|
||||||
}
|
}
|
||||||
|
@ -124,4 +124,11 @@ public class RepairRelationalServiceImpl extends ServiceImpl<RepairRelationalMap
|
|||||||
RepairRelational repairRelational = repairRelationalMapper.selectOne(wrapper);
|
RepairRelational repairRelational = repairRelationalMapper.selectOne(wrapper);
|
||||||
return repairRelational.getTypeId();
|
return repairRelational.getTypeId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectCountByUserId(Long staffId) {
|
||||||
|
QueryWrapper<RepairRelational> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("user_id",staffId);
|
||||||
|
return repairRelationalMapper.selectCount(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,9 @@ public class WxLoginAPIController extends BaseController {
|
|||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(userId);
|
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(userId);
|
||||||
if (null != customerStaff) {
|
if (null != customerStaff) {
|
||||||
|
|
||||||
if (customerStaff.getDataType().equals("3")) customerStaff.setTypeId(repairRelationalService.selectByUserId(customerStaff.getId()));
|
if (customerStaff.getDataType() !=null && customerStaff.getDataType().equals("3")){
|
||||||
|
customerStaff.setTypeId(repairRelationalService.selectByUserId(customerStaff.getId()));
|
||||||
|
}
|
||||||
StaffCustomer staffCustomer = new StaffCustomer();
|
StaffCustomer staffCustomer = new StaffCustomer();
|
||||||
staffCustomer.setStaffId(userId);
|
staffCustomer.setStaffId(userId);
|
||||||
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(userId);
|
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(userId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user