Merge remote-tracking branch 'origin/main'

This commit is contained in:
遥望-何玉明 2024-07-25 09:04:09 +08:00
commit e60ee0d9f8
6 changed files with 25 additions and 0 deletions

View File

@ -230,4 +230,7 @@ public class DisasterInfo implements Serializable {
//分数 //分数
private Integer fraction; private Integer fraction;
//申请数量
private Integer applyForCount;
} }

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.kening.vordm.entity.EntityData; import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestApplyDisasterRef; import com.kening.vordm.entity.GuestApplyDisasterRef;
import com.kening.vordm.service.DisasterInfoService;
import com.kening.vordm.service.GuestApplyDisasterRefService; import com.kening.vordm.service.GuestApplyDisasterRefService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -25,6 +26,8 @@ public class GuestApplyDisasterRefController {
private final GuestApplyDisasterRefService guestApplyDisasterRefService; private final GuestApplyDisasterRefService guestApplyDisasterRefService;
private final DisasterInfoService disasterInfoService;
@GetMapping("/list") @GetMapping("/list")
public R<IPage<GuestApplyDisasterRef>> list(GuestApplyDisasterRef guestApplyDisasterRef, Query query) { public R<IPage<GuestApplyDisasterRef>> list(GuestApplyDisasterRef guestApplyDisasterRef, Query query) {
IPage<GuestApplyDisasterRef> pages = guestApplyDisasterRefService.page(Condition.getPage(query), Condition.getQueryWrapper(guestApplyDisasterRef)); IPage<GuestApplyDisasterRef> pages = guestApplyDisasterRefService.page(Condition.getPage(query), Condition.getQueryWrapper(guestApplyDisasterRef));
@ -36,6 +39,7 @@ public class GuestApplyDisasterRefController {
@PostMapping("/save") @PostMapping("/save")
public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) { public R save(@ApiParam(value = "Influence对象", required = true) @RequestBody GuestApplyDisasterRef guestApplyDisasterRef) {
guestApplyDisasterRef.setApplyTime(new Date()); guestApplyDisasterRef.setApplyTime(new Date());
disasterInfoService.updateApplyForCount(guestApplyDisasterRef.getDisasterId());
return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef)); return R.status(guestApplyDisasterRefService.save(guestApplyDisasterRef));
} }

View File

@ -115,4 +115,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
IPage<DisasterInfo> getUserDisasterInfoListNewB2(IPage<Object> page, @Param("userId") String userId); IPage<DisasterInfo> getUserDisasterInfoListNewB2(IPage<Object> page, @Param("userId") String userId);
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, @Param("userId") String userId); IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, @Param("userId") String userId);
void updateApplyForCount(@Param("id") Long id);
} }

View File

@ -26,6 +26,7 @@
<result property="respondedTime" column="responded_time" jdbcType="TIMESTAMP"/> <result property="respondedTime" column="responded_time" jdbcType="TIMESTAMP"/>
<result property="isEndApply" column="is_end_apply" jdbcType="INTEGER"/> <result property="isEndApply" column="is_end_apply" jdbcType="INTEGER"/>
<result property="fraction" column="fraction" jdbcType="INTEGER"/> <result property="fraction" column="fraction" jdbcType="INTEGER"/>
<result property="applyForCount" column="apply_for_count" jdbcType="INTEGER"/>
</resultMap> </resultMap>
@ -193,6 +194,7 @@
d.responded_time, d.responded_time,
d.is_end_apply, d.is_end_apply,
d.fraction, d.fraction,
IFNULL(d.apply_for_count,0) AS apply_for_count,
ud.review_time AS reviewTime, ud.review_time AS reviewTime,
ud.sponsor_id AS sponsorId, ud.sponsor_id AS sponsorId,
bdb.dict_value as dictValue, bdb.dict_value as dictValue,
@ -1711,4 +1713,11 @@
</where> </where>
</select> </select>
<update id="updateApplyForCount">
UPDATE disaster_info set apply_for_count=IFNULL(apply_for_count,0)+1
<where>
id=#{id}
</where>
</update>
</mapper> </mapper>

View File

@ -96,4 +96,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
List<DisasterInfo> statisticsByUserCountry(Long userId); List<DisasterInfo> statisticsByUserCountry(Long userId);
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, String userId, String roleId); IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, String userId, String roleId);
void updateApplyForCount(Long disasterId);
} }

View File

@ -621,4 +621,9 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
return baseMapper.getUserDisasterInfoListNewB2(page, userId); return baseMapper.getUserDisasterInfoListNewB2(page, userId);
} }
} }
@Override
public void updateApplyForCount(Long disasterId) {
baseMapper.updateApplyForCount(disasterId);
}
} }