更新9.26
This commit is contained in:
parent
2ec927d3b0
commit
aebd7f67d3
@ -104,5 +104,10 @@ public class FleetInfoController extends BaseController {
|
||||
public ResponseObject addFleetInfo(@RequestBody FleetInfo fleetInfo) {
|
||||
return getSuccessResult(fleetInfoService.addFleetInfo(fleetInfo));
|
||||
}
|
||||
|
||||
@GetMapping("/getFleetInfoByFleetId")
|
||||
public ResponseObject getFleetInfoByFleetId(@Param("fleetId")Integer fleetId){
|
||||
return getSuccessResult(fleetInfoService.queryByFleetId(fleetId));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,4 +75,6 @@ public interface FleetInfoService {
|
||||
* @return
|
||||
*/
|
||||
int addFleetInfo(FleetInfo fleetInfo);
|
||||
|
||||
FleetInfoUniVo queryByFleetId(Integer fleetId);
|
||||
}
|
||||
|
@ -296,6 +296,29 @@ public class FleetInfoServiceImpl extends ServiceImpl<FleetInfoMapper,FleetInfo>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FleetInfoUniVo queryByFleetId(Integer fleetId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
//查询当前登录人的车队信息
|
||||
FleetMember fleetMembers = fleetMemberMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
|
||||
.eq(FleetMember::getFleetId, fleetId)
|
||||
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
|
||||
//获取所在车队的id集合
|
||||
// List<Integer> fleetIds = fleetMembers.stream().map(FleetMember::getFleetId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isEmpty(fleetMembers)) {
|
||||
throw new RuntimeException("未绑定车队");
|
||||
}
|
||||
|
||||
FleetInfo fleetInfo = baseMapper.selectOne(new LambdaQueryWrapper<FleetInfo>()
|
||||
.eq(FleetInfo::getId, fleetId));
|
||||
|
||||
|
||||
FleetInfoUniVo fleetInfoUniVo = BeanUtil.copyProperties(fleetInfo, FleetInfoUniVo.class);
|
||||
fleetInfoUniVo.setStoreName(mtStoreMapper.selectById(fleetInfo.getStoreId()).getName());
|
||||
|
||||
return fleetInfoUniVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建用户的基础信息
|
||||
|
@ -350,18 +350,33 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
LambdaQueryWrapper<IntegralSettings> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(IntegralSettings::getStoreId, storeId);
|
||||
IntegralSettings integralSettings = integralSettingsMapper.selectOne(queryWrapper);
|
||||
JSONArray jsonArray = JSONArray.parseArray(integralSettings.getPointsObtained());
|
||||
IntegralSettingsVo integralSettingsVo = new IntegralSettingsVo();
|
||||
List<IntegralSettingsBo> integralSettingsList = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(integralSettings)) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(integralSettings.getPointsObtained());
|
||||
if (ObjectUtil.isNotEmpty(integralSettings.getSignApplicableRules()) && integralSettings.getSignApplicableRules() == 0) {
|
||||
int length = 30;
|
||||
for (int i = 0; i < length; i++) {
|
||||
IntegralSettingsBo integralSettings1 = new IntegralSettingsBo();
|
||||
if (ObjectUtil.isNotEmpty(jsonArray.getJSONObject(0))) {
|
||||
Integer points = Integer.parseInt(jsonArray.getJSONObject(0).get("integral").toString());
|
||||
integralSettings1.setIntegral(points);
|
||||
}
|
||||
integralSettings1.setIntegralName("第" + i + 1 + "天");
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
}else if (ObjectUtil.isNotEmpty(integralSettings.getSignApplicableRules()) && integralSettings.getSignApplicableRules() == 1) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
String day = jsonArray.getJSONObject(i).get("day").toString();
|
||||
Integer points = Integer.parseInt(jsonArray.getJSONObject(i).get("integral").toString());
|
||||
IntegralSettingsBo integralSettings1 = new IntegralSettingsBo();
|
||||
integralSettings1.setIntegralName(day);
|
||||
// integralSettings1.setIntegralName(day);
|
||||
integralSettings1.setIntegralName("第" +( i + 1 )+ "天");
|
||||
integralSettings1.setIntegral(points);
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
integralSettingsVo.setIntegralSettings(integralSettingsList);
|
||||
}
|
||||
|
||||
DateTime now = DateUtil.date();
|
||||
DateTime yesterDay = DateUtil.offsetDay(now, -1);
|
||||
@ -392,10 +407,11 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
numbers.deleteCharAt(0);
|
||||
}
|
||||
integralSettingsVo.setSignInDays(numbers.toString());
|
||||
}else {
|
||||
} else {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
return integralSettingsVo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user