springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerMerchantVO.java
@@ -147,4 +147,6 @@ private String merchantTypeName; @ApiModelProperty(value = "商家积分") private String merchantIntegral; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerMerchant.java
@@ -150,5 +150,8 @@ @ApiModelProperty(value = "商家类型名称") private String merchantTypeName; @ApiModelProperty(value = "商家积分") private String merchantIntegral; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java
@@ -7,15 +7,18 @@ import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; import com.panzhihua.common.model.vos.community.VolunteerMerchantVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao; import com.panzhihua.service_community.entity.VolunteerCreditsExchange; import com.panzhihua.service_community.entity.VolunteerIntegralMerchant; import com.panzhihua.service_community.entity.VolunteerMerchant; import com.panzhihua.service_community.service.VolunteerCreditsExchangeService; import com.panzhihua.service_community.service.VolunteerIntegralMerchantService; import com.panzhihua.service_community.service.VolunteerIntegralRecordService; import com.panzhihua.service_community.service.VolunteerMerchantService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -35,6 +38,9 @@ @Resource private VolunteerIntegralRecordService virService; @Resource private VolunteerMerchantService vmService; @Override @@ -195,11 +201,28 @@ virvo.setCommunityId(item.getCommunityId()); virService.insertVolunteer(virvo); //修改个人积分 int num1=integral-Integer.valueOf(item.getPalyIntegral()); loginUserInfoVOR.setLoveIntegral(num1+""); userService.putUser(loginUserInfoVOR); //修改商家积分 R<VolunteerMerchant> vm= vmService.getById(item.getMerchantId()); int vmNum=0; if(!StringUtils.isEmpty(vm.getData().getMerchantIntegral())) { vmNum=Integer.valueOf(vm.getData().getMerchantIntegral()); } vmNum+=Integer.valueOf(item.getPalyIntegral()); VolunteerMerchantVO vmvo=new VolunteerMerchantVO(); vmvo.setId(item.getMerchantId()); vmvo.setMerchantIntegral(vmNum+""); vmService.updateVolunteerMerchant(vmvo); item.setCondition("3"); //设置订单号 item.setOrderNumber(Snowflake.getId()+""); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerMerchantMapper.xml
@@ -25,6 +25,7 @@ <result property="merchantDiscount" column="merchant_discount" /> <result property="creationTime" column="creation_time" /> <result property="updateTime" column="update_time" /> <result property="merchantIntegral" column="merchant_integral" /> </resultMap> <sql id="beas_sql"> @@ -52,6 +53,7 @@ merchant_state, merchant_discount, creation_time, merchant_integral, update_time </sql> @@ -147,6 +149,9 @@ <if test="vtvo.merchantDiscount != null"> merchant_discount, </if> <if test="vtvo.merchantIntegral != null"> merchant_integral, </if> creation_time </trim> values @@ -210,6 +215,9 @@ </if> <if test="vtvo.merchantDiscount != null"> #{vtvo.merchantDiscount}, </if> <if test="vtvo.merchantIntegral != null"> #{vtvo.merchantIntegral}, </if> sysdate() </trim> @@ -278,6 +286,9 @@ <if test="vtvo.merchantDiscount != null"> merchant_discount=#{vtvo.id}, </if> <if test="vtvo.merchantIntegral != null"> merchant_integral=#{vtvo.merchantIntegral}, </if> update_time=sysdate() </set> where id = #{vtvo.id}