1、会员修改余额提示成功了余额并没有变化

2、素材批量上传报错
3、只要配置都提示错误
4、自动回复提交报错
This commit is contained in:
xuwenbo
2020-05-18 16:49:03 +08:00
parent 7158fca56e
commit 738aa30757
3 changed files with 47 additions and 3 deletions

View File

@ -103,6 +103,6 @@ public class YxWechatReplyServiceImpl extends BaseServiceImpl<WechatReplyMapper,
throw new EntityExistException(YxWechatReply.class,"key",resources.getKey());
}
yxWechatReply.copy(resources);
this.save(yxWechatReply);
this.saveOrUpdate(yxWechatReply);
}
}

View File

@ -20,6 +20,7 @@ import co.yixiang.mp.config.WxPayConfiguration;
import co.yixiang.utils.RedisUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -63,7 +64,8 @@ public class SystemConfigController {
JSONObject jsonObject = JSON.parseObject(jsonStr);
jsonObject.forEach(
(key,value)->{
YxSystemConfig yxSystemConfig = yxSystemConfigService.getOne(new QueryWrapper<YxSystemConfig>().eq("key",key));
YxSystemConfig yxSystemConfig = yxSystemConfigService.getOne(new LambdaQueryWrapper<YxSystemConfig>()
.eq(YxSystemConfig::getMenuName,key));
YxSystemConfig yxSystemConfigModel = new YxSystemConfig();
yxSystemConfigModel.setMenuName(key);
yxSystemConfigModel.setValue(value.toString());

View File

@ -8,9 +8,13 @@
*/
package co.yixiang.modules.shop.service.impl;
import cn.hutool.core.util.NumberUtil;
import co.yixiang.modules.shop.domain.YxUser;
import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.domain.YxUserBill;
import co.yixiang.modules.shop.service.YxUserBillService;
import co.yixiang.modules.shop.service.dto.UserMoneyDto;
import co.yixiang.utils.OrderUtil;
import lombok.AllArgsConstructor;
import co.yixiang.dozer.service.IGenerator;
import com.github.pagehelper.PageInfo;
@ -29,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.io.IOException;
@ -50,6 +55,8 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
private final UserMapper yxUserMapper;
private final YxUserBillService yxUserBillService;
@Override
//@Cacheable
public Map<String, Object> queryAll(YxUserQueryCriteria criteria, Pageable pageable) {
@ -127,7 +134,42 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMoney(UserMoneyDto param) {
//todo 修改用余额
YxUserDto userDTO = generator.convert(getById(param.getUid()),YxUserDto.class);
Double newMoney = 0d;
String mark = "";
String type = "system_add";
Integer pm = 1;
String title = "系统增加余额";
if(param.getPtype() == 1){
mark = "系统增加了"+param.getMoney()+"余额";
newMoney = NumberUtil.add(userDTO.getNowMoney(),param.getMoney()).doubleValue();
}else{
title = "系统减少余额";
mark = "系统扣除了"+param.getMoney()+"余额";
type = "system_sub";
pm = 0;
newMoney = NumberUtil.sub(userDTO.getNowMoney(),param.getMoney()).doubleValue();
if(newMoney < 0) newMoney = 0d;
}
YxUser user = new YxUser();
user.setUid(userDTO.getUid());
user.setNowMoney(BigDecimal.valueOf(newMoney));
saveOrUpdate(user);
YxUserBill userBill = new YxUserBill();
userBill.setUid(userDTO.getUid());
userBill.setLinkId("0");
userBill.setPm(pm);
userBill.setTitle(title);
userBill.setCategory("now_money");
userBill.setType(type);
userBill.setNumber(BigDecimal.valueOf(param.getMoney()));
userBill.setBalance(BigDecimal.valueOf(newMoney));
userBill.setMark(mark);
userBill.setAddTime(OrderUtil.getSecondTimestampTwo());
userBill.setStatus(1);
yxUserBillService.save(userBill);
}
@Override