|
@@ -10,6 +10,7 @@ import com.pj.api.client.admin.AdminInterface;
|
|
|
import com.pj.api.client.level_one_server.LevelOneServerInterface;
|
|
|
import com.pj.api.dto.GoodsDto;
|
|
|
import com.pj.api.dto.MessageDto;
|
|
|
+import com.pj.common.core.utils.StringUtils;
|
|
|
import com.pj.current.config.SystemObject;
|
|
|
import com.pj.current.dto.APPLoginUserInfo;
|
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
@@ -76,17 +77,27 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
|
|
|
}
|
|
|
|
|
|
- boolean purchaserBuy(TbOrders t){
|
|
|
+ boolean purchaserBuy(SoMap so){
|
|
|
|
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
|
|
|
|
|
TbPurchaser purchaser = tbPurchaserMapper.selectById(appLoginInfo.getFk());
|
|
|
if(null == purchaser) throw new RuntimeException("当前收购商账号异常,请重新登录或联系管理员!");
|
|
|
- t.setPurchaserId(purchaser.getId());
|
|
|
- t.setPurchaserName(purchaser.getName());
|
|
|
|
|
|
- return updateById(t);
|
|
|
+ String idStr = so.getString("ids");
|
|
|
+ if(StringUtils.isEmpty(idStr)) throw new RuntimeException("当前购买操作异常,请重新登录或联系管理员!");
|
|
|
+
|
|
|
+ String[] idArr = idStr.split(",");
|
|
|
+ TbOrders orders = new TbOrders();
|
|
|
+ orders.setPurchaserId(purchaser.getId());
|
|
|
+ orders.setPurchaserName(purchaser.getName());
|
|
|
+ for (String id : idArr) {
|
|
|
+ orders.setId(Long.valueOf(id));
|
|
|
+ boolean b = updateById(orders);
|
|
|
+ if(!b) throw new RuntimeException("购买异常,请重新登录或联系管理员!");
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
|