springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCreditsExchangeVO.java
@@ -76,5 +76,10 @@ @ApiModelProperty(value = "核销时间") private String disposeTime; /** * 商品数量 */ @ApiModelProperty(value = "1 社区兑换订单 2商家商品购买订单") private String orderType; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralMerchantVO.java
@@ -15,7 +15,7 @@ @Builder @AllArgsConstructor @NoArgsConstructor @ApiModel("爱心积分商城") @ApiModel("爱心积分商城商品") public class VolunteerIntegralMerchantVO implements Serializable { private static final long serialVersionUID = -70884515430727555L; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCreditsExchange.java
@@ -107,5 +107,11 @@ @ApiModelProperty(value = "商品数量") private String good_num; /** * 商品数量 */ @ApiModelProperty(value = "1 社区兑换订单 2商家商品购买订单") private String orderType; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java
@@ -5,6 +5,7 @@ import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.Snowflake; @@ -67,6 +68,27 @@ return R.fail("商品不存在"); } if(StringUtils.isEmpty(goods.getGoodNum())) { return R.fail("商品库存不足"); } else { int goodNum=Integer.valueOf(goods.getGoodNum()); if(goodNum<=0) { return R.fail("商品库存不足"); } goodNum--; VolunteerIntegralMerchantVO vo=new VolunteerIntegralMerchantVO(); vo.setId(goods.getId()); vo.setGoodNum(goodNum+""); goodsService.updateById(vo); } LoginUserInfoVO loginUserInfoVOR=userService.getUserInfoByUserId(item.getUserId()).getData(); int integral=0; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCreditsExchangeMapper.xml
@@ -15,6 +15,7 @@ <result property="userId" column="user_id" /> <result property="condition" column="condition" /> <result property="disposeTime" column="dispose_time" /> <result property="orderType" column="order_type" /> </resultMap> @@ -33,6 +34,7 @@ vce.condition, vce.dispose_time, vce.community_id, vce.order_type, vce.update_time from volunteer_credits_exchange as vce where vce.id=#{id} @@ -54,6 +56,7 @@ vce.condition, vce.dispose_time, vce.community_id, vce.order_type, vce.update_time from volunteer_credits_exchange as vce <where> @@ -78,6 +81,9 @@ </if> <if test="userId!=null"> and vce.user_id=#{userId} </if> <if test="orderType!=null"> and vce.order_type=#{orderType} </if> </where> order by vce.creation_time desc @@ -116,6 +122,9 @@ <if test="item.disposeTime != null"> dispose_time, </if> <if test="item.orderType != null"> order_type, </if> creation_time </trim> values @@ -149,6 +158,9 @@ </if> <if test="item.disposeTime != null"> #{item.disposeTime}, </if> <if test="item.orderType != null"> #{item.orderType}, </if> sysdate() </trim> @@ -187,16 +199,19 @@ <if test="item.disposeTime != null"> dispose_time=#{item.disposeTime}, </if> <if test="item.orderType != null"> order_type=#{item.orderType}, </if> update_time=sysdate() </set> where id = #{item.id} </update> <update id="conditionData"> update volunteer_credits_exchange set dispose_time=sysdate(),condition='1',update_time=sysdate() where id=#{id} <update id="conditionData" parameterType="String"> update volunteer_credits_exchange as vce set vce.dispose_time=sysdate(),vce.condition='1',vce.update_time=sysdate() where vce.id=#{id} </update>