| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | String userId = reqJson.getString("userId"); |
| | | if(StringUtil.isEmpty(userId)){ |
| | | userId = context.getReqHeaders().get("user-id"); |
| | | } |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | userDto.setPage(1); |
| | |
| | | String acceptUserId = paramInJson.getString("acceptUserId"); |
| | | //获取接受转赠用户名称 |
| | | String acceptUserName = paramInJson.getString("acceptUserName"); |
| | | //批次 |
| | | String timesId = paramIn.getString("timesId"); |
| | | //获取商户id |
| | | String storeId = paramInJson.getString("storeId"); |
| | | JSONObject allocationUserStorehouseJson = new JSONObject(); |
| | |
| | | userStorePo.setStock(String.valueOf(stockNumber)); |
| | | } |
| | | userStorePo.setUsId(userStorehouses.get(0).getUsId()); |
| | | userStorePo.setTimesId(timesId); |
| | | //更新当前用户的库存数量 |
| | | flag1 = userStorehouseV1InnerServiceSMOImpl.updateUserStorehouse(userStorePo); |
| | | if(flag1 <1){ |
| | |
| | | } |
| | | userStorePo.setMiniStock(giveQuantity); |
| | | userStorePo.setUserId(acceptUserId); |
| | | userStorePo.setTimesId(timesId); |
| | | //保存接受转赠用户个人物品信息 |
| | | flag1 = userStorehouseV1InnerServiceSMOImpl.updateUserStorehouse(userStorePo); |
| | | flag1 = userStorehouseV1InnerServiceSMOImpl.saveUserStorehouse(userStorePo); |
| | | if(flag1 <1){ |
| | | throw new CmdException("保存失败"); |
| | | } } |