|
@@ -1159,7 +1159,7 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
FamilyMembers familyMembers = familyMembersMapper.selectById(appOrderProInfo.getFamilyUserId());
|
|
FamilyMembers familyMembers = familyMembersMapper.selectById(appOrderProInfo.getFamilyUserId());
|
|
|
for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getSiteId, appSite.getId()))) {
|
|
for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getSiteId, appSite.getId()))) {
|
|
|
- if (null != appDevice) {
|
|
|
|
|
|
|
+ if (null != appDevice && proInfo1 != null && proInfo2 != null) {
|
|
|
JsonObject addUserJson = JsonParser.parseString(addUser(new DateTime(proInfo2.getExpireTime()),
|
|
JsonObject addUserJson = JsonParser.parseString(addUser(new DateTime(proInfo2.getExpireTime()),
|
|
|
appDevice.getDeviceSerial(),
|
|
appDevice.getDeviceSerial(),
|
|
|
appOrderProInfo.getUserName(),
|
|
appOrderProInfo.getUserName(),
|
|
@@ -1169,6 +1169,16 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0) {
|
|
if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0) {
|
|
|
throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if (null != appDevice) {
|
|
|
|
|
+ JsonObject addUserJson = JsonParser.parseString(addUser(new Date(),
|
|
|
|
|
+ appDevice.getDeviceSerial(),
|
|
|
|
|
+ appOrderProInfo.getUserName(),
|
|
|
|
|
+ familyMembers.getId(), new DateTime(appOrderProInfo.getExpireTime()))).getAsJsonObject();
|
|
|
|
|
+ JsonObject addFaceJson = JsonParser.parseString(addFace(appDevice.getDeviceSerial(), familyMembers.getId(),
|
|
|
|
|
+ familyMembers.getRealNameImg())).getAsJsonObject();
|
|
|
|
|
+ if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0) {
|
|
|
|
|
+ throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1246,16 +1256,29 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
|
|
|
.orderByAsc(AppOrderProInfo::getExpireTime)
|
|
.orderByAsc(AppOrderProInfo::getExpireTime)
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getOrgCode, appOrder.getOrgCode()))) {
|
|
for (AppDevice appDevice : appDeviceMapper.selectList(Wrappers.<AppDevice>lambdaQuery().eq(AppDevice::getOrgCode, appOrder.getOrgCode()))) {
|
|
|
- String addUser = addUser(new DateTime(proInfo2.getExpireTime()),
|
|
|
|
|
- appDevice.getDeviceSerial(),
|
|
|
|
|
- appOrderProInfo.getUserName(),
|
|
|
|
|
- familyMembers.getId(), new DateTime(proInfo1.getExpireTime()));
|
|
|
|
|
- String addFace = addFace(appDevice.getDeviceSerial(), familyMembers.getId(),
|
|
|
|
|
- familyMembers.getRealNameImg());
|
|
|
|
|
- JsonObject addUserJson = JsonParser.parseString(addUser).getAsJsonObject();
|
|
|
|
|
- JsonObject addFaceJson = JsonParser.parseString(addFace).getAsJsonObject();
|
|
|
|
|
- if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0)
|
|
|
|
|
- throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
|
|
|
|
|
+ if(proInfo1 != null && proInfo2 != null){
|
|
|
|
|
+ String addUser = addUser(new DateTime(proInfo2.getExpireTime()),
|
|
|
|
|
+ appDevice.getDeviceSerial(),
|
|
|
|
|
+ appOrderProInfo.getUserName(),
|
|
|
|
|
+ familyMembers.getId(), new DateTime(proInfo1.getExpireTime()));
|
|
|
|
|
+ String addFace = addFace(appDevice.getDeviceSerial(), familyMembers.getId(),
|
|
|
|
|
+ familyMembers.getRealNameImg());
|
|
|
|
|
+ JsonObject addUserJson = JsonParser.parseString(addUser).getAsJsonObject();
|
|
|
|
|
+ JsonObject addFaceJson = JsonParser.parseString(addFace).getAsJsonObject();
|
|
|
|
|
+ if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0)
|
|
|
|
|
+ throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ String addUser = addUser(appSitePriceRulesMapper.selectById(appOrderProInfo.getProductId()).getDateOfSale(),
|
|
|
|
|
+ appDevice.getDeviceSerial(),
|
|
|
|
|
+ appOrderProInfo.getUserName(),
|
|
|
|
|
+ familyMembers.getId(), null);
|
|
|
|
|
+ String addFace = addFace(appDevice.getDeviceSerial(), familyMembers.getId(),
|
|
|
|
|
+ familyMembers.getRealNameImg());
|
|
|
|
|
+ JsonObject addUserJson = JsonParser.parseString(addUser).getAsJsonObject();
|
|
|
|
|
+ JsonObject addFaceJson = JsonParser.parseString(addFace).getAsJsonObject();
|
|
|
|
|
+ if (addUserJson.get("code").getAsInt() != 0 && addFaceJson.get("code").getAsInt() != 0)
|
|
|
|
|
+ throw new JeecgBootException("设备录入用户信息失败!请联系管理员");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|