mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-08-08 18:32:42 +08:00
修改了分类接口
This commit is contained in:
parent
2958b009c4
commit
fa74e1276c
@ -130,12 +130,29 @@ public class RepairDeviceTypeController extends BaseController {
|
||||
@RequiresPermissions("RepairDeviceType:type:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody RepairDeviceType repairDeviceType) {
|
||||
int i = repairDeviceTypeService.updateRepairDeviceType(repairDeviceType);
|
||||
if (i<=0){
|
||||
return R.error("修改失败");
|
||||
|
||||
List<RepairRelational> repairRelationals = repairRelationalService.selectByTypeId(repairDeviceType.getId());
|
||||
for (RepairRelational repairRelational : repairRelationals) {
|
||||
if (repairRelational.getKind()==1){
|
||||
IcsCustomerStaff staff = new IcsCustomerStaff();
|
||||
staff.setId(repairRelational.getUserId());
|
||||
staff.setDataType("1");
|
||||
customerStaffService.updateIcsCustomerStaff(staff);
|
||||
}else if (repairRelational.getKind()==3){
|
||||
IcsCustomerStaff staff1 = new IcsCustomerStaff();
|
||||
staff1.setId(repairRelational.getUserId());
|
||||
staff1.setDataType("1");
|
||||
customerStaffService.updateIcsCustomerStaff(staff1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int i1 = repairRelationalService.deleteByTypeId(repairDeviceType.getId());
|
||||
if (i1>=0){
|
||||
|
||||
|
||||
|
||||
|
||||
//保存成功后,添加设备与派单员关联关系
|
||||
RepairRelational repairRelational = new RepairRelational();
|
||||
repairRelational.setTypeId(repairDeviceType.getId());
|
||||
@ -162,8 +179,12 @@ public class RepairDeviceTypeController extends BaseController {
|
||||
}
|
||||
|
||||
//修改用户信息
|
||||
}
|
||||
|
||||
}
|
||||
int i = repairDeviceTypeService.updateRepairDeviceType(repairDeviceType);
|
||||
if (i<=0){
|
||||
return R.error("修改失败");
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
|
@ -256,45 +256,12 @@ public class WxLoginAPIController extends BaseController {
|
||||
StaffOpen staffOpen = staffOpenService.selectStaffOpenByStaffIdAndOpenId(customerStaff.getId(),openid);
|
||||
|
||||
if (staffOpen != null) {
|
||||
// 根据 用户绑定的企业 绑定对应的设备
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
Customer customer = customerService.selectCustomerById(customerStaff.getIcsCustomerId());
|
||||
if (null != customer) {
|
||||
String roomId = customer.getRoomId();
|
||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
//获取了房间集合,循环对应集合,
|
||||
for (Long id : collect) {
|
||||
List<RoomEquipment> roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(roomEquipment)) {
|
||||
for (RoomEquipment equipment : roomEquipment) {
|
||||
ids.add(equipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(customerStaff.getId());
|
||||
userEquipment.setStartTime(customer.getStartDate());
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
StaffOpen staffOpen1 = new StaffOpen();
|
||||
staffOpen1.setOpenid(openid);
|
||||
staffOpen1.setStaffId(customerStaff.getId());
|
||||
// staffOpen1.setParkId(Long.valueOf(parkId));
|
||||
// staffOpen1.setTenantId(Long.valueOf(tenantId));
|
||||
|
||||
staffOpenService.insertStaffOpen(staffOpen1);
|
||||
}
|
||||
if (parkId != null) {
|
||||
@ -318,14 +285,14 @@ public class WxLoginAPIController extends BaseController {
|
||||
icsCustomerStaff.setUsername(phoneNumber);
|
||||
icsCustomerStaff.setGender("0");
|
||||
icsCustomerStaff.setStatus("0");
|
||||
icsCustomerStaff.setDataType("1");
|
||||
icsCustomerStaff.setOpenid(openid);
|
||||
int i = icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff);
|
||||
|
||||
StaffOpen staffOpen1 = new StaffOpen();
|
||||
staffOpen1.setOpenid(openid);
|
||||
staffOpen1.setStaffId(icsCustomerStaff.getId());
|
||||
// staffOpen1.setParkId(Long.valueOf(parkId));
|
||||
// staffOpen1.setTenantId(Long.valueOf(tenantId));
|
||||
|
||||
staffOpenService.insertStaffOpen(staffOpen1);
|
||||
|
||||
Map<String, Object> token = tokenService.createStaffToken(icsCustomerStaff);
|
||||
@ -333,35 +300,6 @@ public class WxLoginAPIController extends BaseController {
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("user", icsCustomerStaff);
|
||||
ajax.put("openid", openid);
|
||||
|
||||
|
||||
// IcsCustomerStaff customerStaff1 = icsCustomerStaffService.selectUserByMobile(phoneNumber);
|
||||
// //如果手机号等于null 就新增用户
|
||||
// if (null == customerStaff1) {
|
||||
// icsCustomerStaff.setUsername(phoneNumber);
|
||||
// icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
||||
// icsCustomerStaff.setOpenid(openid);
|
||||
// icsCustomerStaff.setGender("0");
|
||||
// icsCustomerStaff.setStatus("0");
|
||||
// int i = icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff);
|
||||
// Map<String, Object> token = tokenService.createStaffToken(icsCustomerStaff);
|
||||
// R ajax = R.ok();
|
||||
// ajax.put(Constants.TOKEN, token);
|
||||
// ajax.put("user", icsCustomerStaff);
|
||||
// ajax.put("openid", openid);
|
||||
// return ajax;
|
||||
// } else {
|
||||
// String openid1 = customerStaff1.getOpenid();
|
||||
// customerStaff1.setOpenid(openid1 + "," + openid);
|
||||
// icsCustomerStaffService.updateIcsCustomerStaff(customerStaff1);
|
||||
// User user = new User();
|
||||
// PublishFactory.recordLoginInfo(customerStaff1.getUsername(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
// BeanUtils.copyBeanProp(user, customerStaff1);
|
||||
// Map<String, Object> token = tokenService.createToken(user);
|
||||
// R ajax = R.ok();
|
||||
// ajax.put(Constants.TOKEN, token);
|
||||
// ajax.put("user", user);
|
||||
// ajax.put("openid", openid);
|
||||
return ajax;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user