Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
e60ee0d9f8
|
@ -230,4 +230,7 @@ public class DisasterInfo implements Serializable {
|
|||
//分数
|
||||
private Integer fraction;
|
||||
|
||||
//申请数量
|
||||
private Integer applyForCount;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.kening.vordm.entity.EntityData;
|
||||
import com.kening.vordm.entity.GuestApplyDisasterRef;
|
||||
import com.kening.vordm.service.DisasterInfoService;
|
||||
import com.kening.vordm.service.GuestApplyDisasterRefService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
|
@ -25,6 +26,8 @@ public class GuestApplyDisasterRefController {
|
|||
|
||||
private final GuestApplyDisasterRefService guestApplyDisasterRefService;
|
||||
|
||||
private final DisasterInfoService disasterInfoService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<IPage<GuestApplyDisasterRef>> list(GuestApplyDisasterRef guestApplyDisasterRef, Query query) {
|
||||
IPage<GuestApplyDisasterRef> pages = guestApplyDisasterRefService.page(Condition.getPage(query), Condition.getQueryWrapper(guestApplyDisasterRef));
|
||||
|
@ -36,6 +39,7 @@ public class GuestApplyDisasterRefController {
|
|||
@PostMapping("/save")
|
||||
public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
|
||||
guestApplyDisasterRef.setApplyTime(new Date());
|
||||
disasterInfoService.updateApplyForCount(guestApplyDisasterRef.getDisasterId());
|
||||
return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef));
|
||||
}
|
||||
|
||||
|
|
|
@ -115,4 +115,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
|
|||
IPage<DisasterInfo> getUserDisasterInfoListNewB2(IPage<Object> page, @Param("userId") String userId);
|
||||
|
||||
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, @Param("userId") String userId);
|
||||
|
||||
void updateApplyForCount(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<result property="respondedTime" column="responded_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isEndApply" column="is_end_apply" jdbcType="INTEGER"/>
|
||||
<result property="fraction" column="fraction" jdbcType="INTEGER"/>
|
||||
<result property="applyForCount" column="apply_for_count" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
@ -193,6 +194,7 @@
|
|||
d.responded_time,
|
||||
d.is_end_apply,
|
||||
d.fraction,
|
||||
IFNULL(d.apply_for_count,0) AS apply_for_count,
|
||||
ud.review_time AS reviewTime,
|
||||
ud.sponsor_id AS sponsorId,
|
||||
bdb.dict_value as dictValue,
|
||||
|
@ -1711,4 +1713,11 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateApplyForCount">
|
||||
UPDATE disaster_info set apply_for_count=IFNULL(apply_for_count,0)+1
|
||||
<where>
|
||||
id=#{id}
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
@ -96,4 +96,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
|
|||
List<DisasterInfo> statisticsByUserCountry(Long userId);
|
||||
|
||||
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, String userId, String roleId);
|
||||
|
||||
void updateApplyForCount(Long disasterId);
|
||||
}
|
||||
|
|
|
@ -621,4 +621,9 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
|
|||
return baseMapper.getUserDisasterInfoListNewB2(page, userId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateApplyForCount(Long disasterId) {
|
||||
baseMapper.updateApplyForCount(disasterId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue